#include<bits/stdc++.h>
using namespace std;
int k;
struct st{
long long a,b,c;
}x[100010];
int g,h;
bool d=false;
int main(){
cin>>k;
for(int i=1;i<=k;i++){
cin>>x[i].a>>x[i].b>>x[i].c;
}
for(int i=1;i<=k;i++){
for(int j=1;j<=sqrt(x[i].a);j++){
int l=x[i].a/j;
if(j*l==x[i].a&&j+l==x[i].a-x[i].b*x[i].c+2){
g=j,h=l;
d=true;
break;
}
}
if(d==true){
cout<<g<<" "<<h<<endl;
}else{
cout<<"NO"<<endl;
}
d=false;
}
}