TLE showing for one test case

my solution got accepted on SPOJ but here it is giving TL for one test case.
Link to my Solution : https://ide.codingblocks.com/s/187515

@O17LPOLA020011 hi bro us case me integer overflow horha hai to calculations me jha bhi mod nhi lgaya wha bhi lga do ,yani inner bracket wali calculations me bhi mod lelo.

MOD har jagah lagaya hai, power function n=1 k liye nhi chal rha tha, n=1 pe b[0] return kr diya toh chal gaya, Thanks Anyways

@O17LPOLA020011 ok ,as a suggestion mod inner calculations pe bhi lga lia kro so that integer overflow na ho ,you get your mistake.

Sure, will keep that in mind :+1: