#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>h>>w; w=abs(w); Int ans=0; if(h>=w){ ans+=(h-(w-1)); h=w-1; } for(Int i=1;i<=h;i<<=1){ Int j=min((i<<1)-1,h); Int len=j-i+1; ans+=len*(w/i); Int res=w%i; ans+=res; } cout<