Kth Root Failing in two test cases

I am able to pass only the second test case. I have not used binary search. Rather I used bitmasking to find the exponentiation. I am not getting time exceeded error. Plz help me.
Here is the codehttps://ide.codingblocks.com/s/63768

Hi Abhishek, you code is giving wrong answer for many cases. Some of the examples are:
41687671 156
1009989076 9739

The expected output is:
1
1
But your code gives
2
2
So, try to work around these testcases.