Codeforces Round #473 (Div. 2), problem: (E) Mahmoud and Ehab and the xor-MST Solution In C/C++ C/C++ Programming April 18, 2018 0 Admin #include <stdio.h> long long n,res,a=1; int main() { for (scanf(“%I64d”,&n);a<n;res+=(n-1)/a*(a-(a>>1)),a<<=1ll); printf(“%I64d\n”,res); return 0; } Continue