#include using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define replr(i,l,r) for (ll i=(ll)(l);i<(ll)(r);i++) #define all(v) v.begin(),v.end() #define len(v) ((ll)v.size()) template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a #include template using super_set=__gnu_pbds::tree,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>; ll f(vector v){ super_set stx; super_set sty; ll ret=0; rep(i,len(v)){ ret+=sty.order_of_key({v[i].second,-INF}); ret-=stx.order_of_key({v[i].first,v[i].second,-INF})-stx.order_of_key({v[i].first,-INF,-INF}); stx.insert({v[i].first,v[i].second,i}); sty.insert({v[i].second,i}); } return ret; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll n; cin >> n; vector x(n),y(n); vector v(n); rep(i,n){ cin >> x[i] >> y[i]; v[i]={x[i],y[i]}; } sort(all(v)); ll p=f(v); rep(i,n){ v[i].first*=-1; } sort(all(v)); ll q=f(v); map cx,cy; ll r=0,s=0; rep(i,n){ r+=i-cx[x[i]]; cx[x[i]]++; s+=i-cy[y[i]]; cy[y[i]]++; } cout << fixed << setprecision(10) << (ld)(p-q)/sqrtl((ld)r*s) << '\n'; }