#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll T,n,e,d;
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin>>T;
while(T--){
cin>>n>>e>>d;
int m=n-e*d+2,sp=sqrt(m*m-4*n);
if(sp<0){
cout<<"NO\n";
continue;
}
int p=(sp+m)/2,q=(m-sp)/2;
if(p>q) swap(p,q);
if(p&&q&&p*q==n&&(p-1)*(q-1)+1==e*d) cout<<p<<' '<<q<<'\n';
else cout<<"NO\n";
}
return 0;
}