#include<bits/stdc++.h>
#define ll long long
using namespace std;
int t;
int main(){
cin>>t;
while(t--){
ll q,e,d;
cin>>q>>e>>d;
ll n=q;
ll m=n-e*d+2;
ll t1=abs(m/2-sqrt(-n+pow(m/2,2)));
ll t2=m-t1;
if(t1*t2==n){
if(t1>t2) swap(t1,t2);
cout<<t1<<' '<<t2<<endl;
}else{
cout<<"NO"<<endl;
}
}
return 0;
}