#include<bits/stdc++.h>
using namespace std;
int k,p,q,n,e,d;
int main(){
ios::sync_with_stdio(false);
cin>>k;
while(k--){
cin>>n>>d>>e;
bool l=false;
int x=n-e*d;
for(int i=1;i<=x/2;i++){
for(int j=x/2+1;j<=x;j++){
if(i+j==x&&i*j==n){
l=true;
cout<<i<<" "<<j<<endl;
break;
}
}
if(l==1){
break;
}
}
if(l==0){
cout<<"NO"<<endl;
}
}
return 0;
}