what is output if -(10^11)(10^9+7)?? is it ans + (10^9+7) or ans(10^9+7)+(10^9+7)???
This should be the answer.
I guess that is ans%MOD + MOD.
what should i do when the ans is greater than 10^18 or less than -10^18.
The operator does not work for that range.... -10^21(10^9+7) = ???
Hey once you think you are “storing” 10^21 in a variable in C/C++ then dont think you have any control over it. Basically you should focus towards avoiding it at first place.
for ans = -mod, you formula gives mod, while the right answer is 0.
so you wanna say that ans > (10^18) would’t present in any test case??
I have checked my code, it gave right ans for over 50 test cases…
instead of that, i am getting wrong ans…what am i missing ,can anyone tell me.