Since only c++ code was available on the edittorial I wasn’t able to understand.
I solved using java but all testcases did not pass
here is my code:
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
long n,k;
long ans;
double z;
int i;
for(i=0;i<t;i++)
{
n=sc.nextLong();
k=sc.nextLong();
ans=(long)(Math.pow(n,(double)(long)(1)/k));
System.out.println(ans);
}
}
}