#include #include #include #include using namespace std; int n,x[210],y[210],d[210],rx[210],ry[210]; struct heap { int t1,t2; bool cmp(const int &u,const int &v) { return t1*x[u]+t2*y[u]>t1*x[v]+t2*y[v]; } int n,h[210],e[210]; void del(int i) { e[h[i]]=0; if (i==n) { n--; return; } h[i]=h[n--]; e[h[i]]=i; down(i); up(i); } void build(void) { for(int i=(n>>1);i>=1;i--) down(i); } void up(int i) { int t,j; while(i>1) { j=(i>>1); if (cmp(h[i],h[j])) { t=h[i]; h[i]=h[j]; h[j]=t; e[h[i]]=i; e[h[j]]=j; } else break; i=j; } } void down(int i) { int t,j; while((j=(i<<1))<=n) { if (j=1;i--) { l1=x[h1.h[1]]+y[h1.h[1]]-d[i]; r1=x[h3.h[1]]+y[h3.h[1]]+d[i]; l2=-x[h2.h[1]]+y[h2.h[1]]-d[i]; r2=-x[h4.h[1]]+y[h4.h[1]]+d[i]; if (i