I am getting TLE on last test case of this problem Link to the problem, i used Big mod for multiplication while calculating power as we need last ten digits so we have to modulo it by 1e10 which will overflow in C++.
Any type of help is appreciated. Thanks in advance.