TLE for my solution when x >pow(10, 10)

This is my solution

i am not able to understand the solution given in the editorial

Hey @tAkshat can you please elaborate where are you getting troubled at?

If you want code for reference, you can have it here https://ide.codingblocks.com/s/329221
This might help :grinning: