#include<bits/stdc++.h>
using namespace std;
int main(){
int k;
long long n,d,e;
bool f;
cin>>k;
for(int i=0;i<k;i++){
cin>>n>>d>>e;
f=true;
for(int j=1;j*j<=n;j++){
if(n%j==0){
long long p=j;
long long q=n/p;
if((p-1)*(q-1)+1==d*e){
cout<<p<<' '<<q<<endl;
f=false;
break;
}
}
}
if(f){
cout<<"NO"<<endl;
continue;
}
}
return 0;
}