The main purpose of binary multiplication is to solve the multiplication result far beyond the int range, but the result needs to have a remainder multiplication operation
LL multi(LL a,LL b,LL m) { LL ans = 0; a %= m; while(b) { if(b & 1) { years = (years + a) % m; b--; } b >>= 1; a = (a + a) % m; } return ans; }