#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- int N; ll P,Q,R,S; ll X[202020],Y[202020]; map Xs,Ys; template class BIT { public: V bit[1< bt1,bt2; bool cmp(vector& L,vector& R) { ll a=L[1]*R[0]-L[0]*R[1]; if(a<0) return 1; if(a>0) return 0; return L[2]& L,vector& R) { ll a=L[1]*R[0]-L[0]*R[1]; if(a>0) return 1; if(a<0) return 0; return L[2]& L,vector& R) { ll a=L[1]*R[0]-L[0]*R[1]; if(a>=0) return 1; return 0; } void solve() { int i,j,k,l,r,x,y; string s; cin>>N; vector YY={-1<<30}; FOR(i,N) { cin>>X[i]>>Y[i]; YY.push_back(Y[i]); Xs[X[i]]++; Ys[Y[i]]++; } FORR2(a,b,Xs) R+=b*(N-b); FORR2(a,b,Ys) S+=b*(N-b); sort(ALL(YY)); YY.erase(unique(ALL(YY)),YY.end()); vector> Ps[2]; FOR(i,N) { Y[i]=lower_bound(ALL(YY),Y[i])-YY.begin(); Ps[0].push_back({-X[i],Y[i]}); Ps[1].push_back({X[i],Y[i]}); } sort(ALL(Ps[0])); sort(ALL(Ps[1])); FORR2(x,y,Ps[0]) { P+=bt1(N)-bt1(y); bt1.add(y,1); } FORR2(x,y,Ps[1]) { Q+=bt2(N)-bt2(y); bt2.add(y,1); } R/=2; S/=2; double a=R; a*=S; a=sqrt(a); double b=P-Q; //cout<