/* * NWERC'14 - Solution by Jeroen Bransen */ #include #include #include typedef long long ll; using namespace std; int n; ll x[100000],y[100000],q[200000],a,b,e,f,r,d,z; ll m(ll *a, int n) { nth_element(a,a+n/2,a+n); return a[n/2]; } void c(ll v, ll w) { if(a>v-w||v-w>b||e>v+w||v+w>f) return; ll s=0; for(int i=0;ib||e>f) { printf("impossible\n"); return 0; } c(m(x,n),m(y,n)); ll g[2]={a,b}, h[2]={e,f},p[4][3]={{a,1},{b,1},{e,-1},{f,-1}}; for(i=0;i<16;i++) c((g[i&1]+h[(i>>1)&1]+((i>>2)&1))/2,h[(i>>1)&1]-(g[i&1]+h[(i>>1)&1]+(i>>3))/2); for(i=0;i<4;i++) { for(j=0;j