#include <iostream>
#include <cmath>
using namespace std;
int main() {
double a, sum;
int n;
cin >> n;
sum = 0;
for(int i = 0; i < n; i++)
{
cin >> a;
sum += a;
}
cout << 2*sum*sum;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKSB7Cglkb3VibGUgYSwgc3VtOwoJaW50IG47CgljaW4gPj4gbjsKCXN1bSA9ICAwOwoJZm9yKGludCBpID0gIDA7IGkgPCBuOyBpKyspCiAgCXsKCQljaW4gPj4gYTsKCQlzdW0gKz0gYTsKICAJfQoJY291dCA8PCAyKnN1bSpzdW07CglyZXR1cm4gMDsKfQ==