Kth root- wrong answer

code: #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
while(t–)
{
int n,k;
cin>>n>>k;
int x=0;

	if(pow(x,k)<=n)
	{
		x++;
		cout<<x;
	}
}
return 0;

}

Hello @vashishthkuntal.gajjar2019 please wait i am checking your code.

#include<bits/stdc++.h>

using namespace std;

int main() {

int t;

cin>>t;

while(t–)

{

int n,k;

cin>>n>>k;

int x=0;

while(pow(x,k)<=n)

{

x++;

// cout<<x;

}

cout<<x<<endl;

}

return 0;

}

this is the correct code but it is giving tle as the test cases are larger.
it is not optimised.

@vashishthkuntal.gajjar2019 you can see this code.