ll a[3d5],n,x,j,k; Rand r; { rd(n,x); a[0..2d5]=(1..); x^=(1..n); while(swap(a[j=-~j%n],a[k=r.get(1d5+5-n)+n]),x^=a[j]^a[k]); wt(a(n)); }