#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< 1){ if(!(t%2)){ t += m; res += i; } t /= 2; rr /= 2; i *= 2; } return res; } inline ll MR(ll x){ ll t = (x + ((x * mm) & rmsk)*m) >> rsh; return t>n>>m; if(m == 2){ cout<<0<