#include #define REP(i,b,e) for(int i=b;i>i)&1); ll a = (1 << cnt) / 2, ans = 0; REP(i, 0, 60) if((n>>i)&1) { if(a&1) ans |= (1<>= 1; } printf("%ld\n", ans); return 0; }