Solution got Accepted in SPOJ but gives wrong answer in CB

Solution got Accepted in SPOJ but gives wrong answer in CB for 2 test cases.
Link to my Code : https://ide.codingblocks.com/s/188328

@O17LPOLA020011 hi,your logic is correct there is problem of size and overflow of integer in your compute function ,please see to it and take the case for 0 as you have left in version 1.

Thanks, It’s working now :+1:

@O17LPOLA020011 please close the doubt and give good rating if I got you understand.

@O17LPOLA020011 i am having the same problem…link to my code
got accepted on spoj but not on HB

@shameek.agarwal hey use modulo with every operation and this is not submitting due to overflow of integers so use modulo operator.