#include <iostream>
#include <sstream>
#include <cmath>
#define ll long long
using namespace std;
ll k1,k2;
ll s[10005];
int head=0;
ll f(ll left,ll right,ll n,ll e,ll d){
ll a,b;
while (left<=right){
ll mid=(left+right)/2;
a=s[mid];
b=n/s[mid];
if (e*d==(a-1)*(b-1)+1){
return a;
}
if ((a-1)*(b-1)+1<=e*d) left=mid+1;
else right=mid-1;
}
return -1;
}
int main(){
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll t;
cin>>t;
while (t--){
head=0;
ll n,e,d;
cin>>n>>e>>d;
for (int i=1;i<=sqrt(n);i++){
if (n%i==0) s[++head]=i;
}
ll k1=f(1,head,n,e,d);
if (k1!=-1){
ll k2=n/k1;
cout <<k1<<' '<<k2<<endl;
}else cout <<"NO"<<endl;
}
return 0;
}
RT