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
Solution got Accepted in SPOJ but gives wrong answer in CB
@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 
@shameek.agarwal hey use modulo with every operation and this is not submitting due to overflow of integers so use modulo operator.