#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef __int64 int64; const int maxn = 2000005; const int inf = 0x7fffffff; const double pi=acos(-1.0); const double eps = 1e-8; struct node{ int pi,di; }a[ maxn ]; int cmp( node a,node b ){ if( a.di!=b.di ) return a.di>b.di; else return a.pi,greater > q; for( int i=0;i