#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; vector a(n); for(Int i=0;i>a[i]; sort(a.begin(),a.end()); function dfs= [&](Int l,Int r,Int d)->Int{ Int x=(a[l]>>d)&1,y=(a[r-1]>>d)&1; if(d==0) return x!=y; if(x==y) return dfs(l,r,d-1); Int m=lower_bound(a.begin(),a.end(),a[r-1]&~((1<