#include <bits/stdc++.h>

#define ms(a,b) memset(a, b, sizeof(a))
#define rep(a,b,c) for(int a = (int)(b); a < (int)(c); a++)
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define m_p(a,b) make_pair(a, b)
#define lson l,mid,o << 1
#define rson mid + 1,r,o << 1 | 1
#define ls o << 1
#define rs o << 1 | 1
#define inf 0x3f3f3f3f

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;

inline bool isdigit(char& ch) {
	return ch >= '0' && ch <= '9';
}
template<class T>
void read(T &x) {
	x = 0;
	ll f = 1;char ch = getchar();
	for (;!isdigit(ch);ch = getchar()) 
		if (ch == '-') f = -1;
	for (; isdigit(ch);ch = getchar())
		x = (x << 1) + (x << 3) + ch - '0';
	x *= f;
}
template<class T>
inline void write(T x) {
	if (x == 0) {putchar('0');return ;}
	if (x < 0) {putchar('-');x = -x;}
	int _stk[65],_top = 0;
	for (;x;x /= 10) _stk[++_top] = x % 10 + 48;
	for (;_top;_top--)putchar(_stk[_top]);
}

namespace Union {
	vector<int>fa;
	void Assign(int n) {
		fa.assign(n, -1);
	}
	int root(int x) {
		if (fa[x] < 0)
			return x;
		return fa[x] == x ? fa[x] : fa[x] = root(fa[x]);
	}
	bool same(int x, int y) {
		return root(x) == root(y);
	}
	void merge(int x, int y) {
		fa[root(x)] = root(y);
	}
}

using namespace Union;

int main () {
	int n;

	using P = pair<db, db>;
	using Edge = pair<db, pair<int, int>>;

	vector<P>pint;
	cin >> n;
	pint.resize(n);
	for (auto &[x, y] : pint)
		cin >> x >> y;
//	cout << pint.size();
	Assign(n + 2);
	int S  = n, T = n + 1;
	auto calc = [&](P a, P b) {return sqrt((a.fi-b.fi) * (a.fi-b.fi) + (a.se-b.se)*(a.se-b.se));};

	vector<Edge>edge;
	for (int i = 0; i < pint.size(); ++i) {
		edge.push_back({100+pint[i].se, {S, i}});
		edge.push_back({100-pint[i].se, {T, i}});
		for (int j = i + 1; j < pint.size(); ++j) {
			edge.pb({calc(pint[i], pint[j]), {i, j}});
		}
	}
	sort(edge.begin(), edge.end());
	db res = 0;
	for (auto E : edge) {
		merge(E.se.fi, E.se.se);
	//	cout << E.se.fi << " " << E.se.se << " " << E.fi<<endl;
		if (same(S, T)) {
			res = E.fi / 2.0;
			break;
		}
	}
	cout << fixed << setprecision(10) << res << endl;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,s,t) for(int i = (int)(s); i < (int)(t); i++)

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,0,n) cin >> a[i];

    vector<ll> aa(n);
    rep(i,0,n) aa[i] = a[i]*a[i];
    vector<ll> aarec(n);
    aarec[0] = aa[0];
    rep(i,1,n) aarec[i] = aarec[i-1] + aa[i];
    vector<ll> arec(n);
    arec[0] = a[0];
    rep(i,1,n) arec[i] = arec[i-1] + a[i];

    ll ans = 0;
    rep(i,2,n+1) ans += (i - 1)*aa[i - 1];
    rep(i,0,n-1) ans += aarec[i];
    rep(i,2,n+1) ans -= 2*a[i - 1]*arec[i - 2];
    cout << ans << endl;
}