#include<bits/stdc++.h>
using namespace std;
bool f(long long x){
if((long long)(sqrt(x))*(long long)(sqrt(x))==x)
return true;
else return false;
}
int main()
{
freopen("csp2022pj_decode.in","r",stdin);
freopen("csp2022pj_decode.out","w",stdout);
int k;
cin>>k;
while(k--){
long long n,e,d;
cin>>n>>e>>d;
long long t=n-e*d+2,b=n;
long long tmp=sqrt(t*t-4*n);
if(!f(t*t-4*b)){
cout<<"NO"<<endl;
continue;
}
if(abs(t-tmp)%2!=0){
cout<<"NO"<<endl;
continue;
}
else {
long long q=abs(t-tmp);
cout<<min((tmp+t)/2,q/2)<<" "<<max((tmp+t)/2,q/2)<<endl;
}
}
return 0;
}