0pts
#include<bits/stdc++.h>
using namespace std;
int main(){
int k;
cin>>k;
while(k--)
{
bool ok=1;
int n,d,e,pq,j,i;
cin>>n>>d>>e;
pq=n-e*d+2;
for(i=n-1;i>=0;i--)
{
for(j=0;j< n;j++)
if(i*j==n && i+j==pq)
{
cout<<j<<" "<<i<<endl;
ok=0;
break;
}
if(!ok)
{
break;
}
}
if(ok)
cout<<"NO"<<endl;
}
return 0;
}