#include #include #include using namespace std; int n,m; int a[100001]; void input(){ scanf("%d",&n); for(int i=0;i>1; ++i; } return i; } int ibit(int idx,int num){ return (num>>idx) & 1; } bool allsamebit(int idx,vector ar){ bool one = true,zero = true; int n = ar.size(); for(int i=0;i ar){ if(ar.size()==1) return 0; if(idx==0) return !allsamebit(idx,ar); // printf("%d %d\n",idx,allsamebit(idx,ar)); if(allsamebit(idx,ar)) return calc(idx-1,ar); else{ vector one,zero; //set of ith bit is 1/0 int n = ar.size(); for(int i=0;i>idx & 1) one.push_back(ar[i]); else zero.push_back(ar[i]); } // printf("%d %d\n",calc(idx-1,one),calc(idx-1,zero)); return (1< ar; for(int i=0;i