would you please check if my approach is correct or not if it is then why i am not getting answer
here is my code
#include
#include<math.h>
using namespace std;
#define ll long long int
ll KTHRoot(ll n,ll k){
ll s=0,e=n;
ll mid;
while(s<=e){
ll mid=(s+e)/2;
ll result=pow(mid,k);
if(mid<=n){
s=mid+1;
}
else{
e=mid-1;
}
}
return mid;
}
int main() {
int t;
cin>>t;
while(t>0){
ll n,k;
cin>>n>>k;
cout<<KTHRoot(n,k)<<endl;
t--;
}
return 0;
}