#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; /* 考察 P:=(i,j)(i座標圧縮して平面走査かな */ template struct FenwickTree { FenwickTree() = default; FenwickTree(int n) { this->n = n; dat = vector(n); } void add(int i, T x) { i++; while (i <= n) { dat[i - 1] += x; i += i & -i; } } T sum(int l, int r) { return sum(r) - sum(l); } T operator[](int i) { return sum(i, i + 1); } int size() { return n; } private: int n; vector dat; T sum(int r) { T ret = 0; while (r > 0) { ret += dat[r - 1]; r -= r & -r; } return ret; } }; int main() { int N; cin >> N; vector val; vector> P(N); for (int i = 0; i < N; i++) { cin >> P[i].first >> P[i].second; val.push_back(P[i].first); val.push_back(P[i].second); } ranges::sort(val); val.erase(unique(val.begin(), val.end()), val.end()); auto get = [&](ll x) { return ranges::lower_bound(val, x) - val.begin(); }; vector> YS(N * 2); for (int i = 0; i < N; i++) YS[get(P[i].first)].push_back(get(P[i].second)); FenwickTree ft(N * 2); ll cup = 0, cdw = 0; for (int i = N * 2 - 1; i >= 0; i--) { for (int y : YS[i]) { cup += ft.sum(y + 1, 2 * N); cdw += ft.sum(0, y); } for (int y : YS[i]) ft.add(y, 1); } vector cntx(N * 2), cnty(N * 2); for (int i = 0; i < N; i++) { cntx[get(P[i].first)]++; cnty[get(P[i].second)]++; } ll cx = 0, cy = 0; for (int i = 0; i < N * 2; i++) { cx += 1ll * (N - cntx[i]) * cntx[i]; cy += 1ll * (N - cnty[i]) * cnty[i]; } cx /= 2; cy /= 2; double ans = 1.0 * (cup - cdw) / sqrt(cx * cy); printf("%.10lf\n", ans); }