#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); char wbuf[1<<25]; #define rd(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} #define wt(v) {long _z=v;do*--wp=_z%10+48;while(_z/=10);} #define rep(v,e) for(long v=0;v>8|a[i]<<56; } } void radix_sort(unsigned long*a,int n){ static unsigned long b[100000]; radix_sort_aux(a,b,n); radix_sort_aux(b,a,n); radix_sort_aux(a,b,n); radix_sort_aux(b,a,n); radix_sort_aux(a,b,n); radix_sort_aux(b,a,n); radix_sort_aux(a,b,n); radix_sort_aux(b,a,n); } unsigned long a[100000]; main(){ char*rp=mmap(0l,1l<<25,1,2,0,0ll); rd(n); rep(i,n){ rd(t); a[i]=t; } rep(i,n){ rd(d); a[i]=(a[i]<<32)/d<<17|i+1; } radix_sort(a,n); char*wp=wbuf+sizeof wbuf; rrep(i,n){ *--wp=32; wt(a[i]&0x1ffff); } write(1,wp,wbuf+sizeof wbuf-wp); _exit(0); }