Sorting And Searching Kth Root Challenge

Here is my code https://ide.codingblocks.com/s/99199
I think the problem is when mid^k becomes very large and long long int cannot store it.
What should I do?

hey @Mp18, the problem is when you use break in the inner loop, program control is going outside the while loop of testcases also.
Make a function which will be called for every testcase and return the answer.

Moreover take a ans variable and in while(start<=end), inside if condition and else if condition,add additional statement ans =mid. Return this ans to main function.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I made the changes you recommended but the code is still giving wrong answer for large inputs