#include <bits/stdc++.h>
using namespace std;
#define int long long
int t,n,e,d,m,ads;
signed main(){
freopen("csp2022pj_decode.in","r",stdin);
freopen("csp2022pj_decode.out","w",stdout);
cin>>t;
while(t--){
scanf("%lld%lld%lld",&n,&e,&d);
m=e*d;
ads=n-m+2;
int cha=ads*ads-4*n;
int gg=sqrt(cha);
if(gg*gg!=cha){
printf("NO\n");
continue;
}
cha=gg;
int p=(cha+ads)/2;
int q=ads-p;
if(p>q)swap(p,q);
if(p*q==n&&(p-1)*(q-1)+1==m){
printf("%lld %lld\n",p,q);
}else printf("NO\n");
}
return 0;
}