#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,p,n,d,e,k;
ll s1;
ll getans(ll n,ll s1)
{
return abs(((double)(-(n-s1+2))+(double)sqrt(pow(n-s1+2,2)-4*n))/(double)(-2));
}
bool judge(ll p,ll q)
{
return (p*q==n&&(p-1)*(q-1)+1==s1);
}
signed main()
{
cin>>k;
for(int i=1;i<=k;i++)
{
cin>>n>>d>>e;
s1=d*e;
q=getans(n,s1);
p=n/q;
if(judge(p,q))
{
ll mx=max(p,q);
ll mn=min(p,q);
cout<<mn<<" "<<mx<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}