Not able to solve it < Kth Root Problem>

#include
#include

using namespace std;

int main()
{
int T;
cin>>T;
for (int i = 0; i < T; i++)
{
long long int N;
int k;

    cin>>N>>k;
    long long int Start=1,end=N,ans=1;
    while (Start<=end)
    {
        ans=(Start+end)/2;
        if(pow(ans,k)<=N)
        {
        Start=ans+1;
            }
        else
        {
            end=ans-1;
             }
    }

    cout<<ans<<endl;
}
return 0;

}

Hey @rprahulpal03
Don’t use the pow function because it can lead to overflow so instead calculate power using a loop and if it exceeds n then break.
10^8 now if u try to compute power(10^8,10) then this will lead to overflow

Also add case for k==1 simply print n so that u can start high with sqrt(Highest N value)

Hey have u tried this ?