Kth root to find x where x^k<=n

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);

	}
	
}

}

hi @aaayushi534_2b8dbe33159237a1,
u can refer my code https://ide.codingblocks.com/s/643630

@aaayushi534_2b8dbe33159237a1 The test case you’re failing is :
1
1000000000000 6
Try dubgging code for this test case answer should be 100 but your code is giving 99