#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>N; FOR(i,N) cin>>A[i]; sort(A,A+N); reverse(A,A+N); int ret=0; FOR(i,N) if(A[i]) { ret++; x=0; while((1LL<<(x+1))<=A[i]) x++; for(y=i+1;y