Code is not submitting!

i had written exact code as sir’s code but always getting wrong on test case 11 on hacker rank question :: https://www.hackerrank.com/challenges/journey-to-the-moon/problem?isFullScreen=true

sir’s code :: https://ide.codingblocks.com/s/4967

my code id is 168016 on codingblocks ide

Does it fail on hackerblocks as well?
Maybe on hackerrank, taking ll int will work because there’s no problem with logic.

100000 2
1 2
3 4

this is the test case it is not working for…

taking long long int didnt work

Okay thats because we aren’t taking mod. Hence overflowing.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.