import java.util.Scanner;
public class Main5 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
long[] arr = new long[t];
for (int i = 0; i < t; i++) {
arr[i] = in.nextLong();
}
for(long N : arr){
fun(N);
}
}
public static void fun(long N){
if(N%2 != 0){
System.out.println("No");
return ;
}
long X = 0;
long Y = 0;
for(int i=1;i<=N/2;i++){
Y = i*2;
if(N%Y == 0){
X = N/Y;
if(X%2!=0){
System.out.println(X+" "+Y);
return ;
}
}
}
}
已AC通过!