#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);}) #define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define wt(v) ({unsigned _z=v;do*--wp=_z%10+48;while(_z/=10);}) #define wt1(v) ({char wbuf[64],*wp=wbuf+sizeof wbuf;wt(v);write(1,wp,wbuf+sizeof wbuf-wp);}) #define rep(v,e) for(typeof(e)v=0;v=(a)?v:(a)) int n; unsigned a[1500]; unsigned q[1501]; unsigned b[1500]; void sort_aux(unsigned*a,unsigned*b){ int c[256]; for(int i=0;i<256;++i){ c[i]=0; } for(int i=0;i>8|a[i]<<24; } } void f1(){ rd_init(); n=rd(); rep(i,n){ a[i]=rd()<<16; } rep(i,n){ b[i]=rd()>>1<<16|1; } } void f2(){ sort_aux(a,q); sort_aux(q,a); sort_aux(a,q); sort_aux(q,a); q[n]=~0; } void f3(){ int z=n; rep(h,n){ rep(i,n){ q[i]=a[i]; } int w=0; rep(i,n){ int j=h+i; j-=j>=n?n:0; unsigned t=q[0]+b[j]; unsigned y=t&0xffff; if(y>=z){ goto hoge; } chmax(w,y); int k=0; while(k*2