#include<bits/stdc++.h>
using namespace std;
long long n,e,d,q,p,m,i,si;
int main() {
ios::sync_with_stdio(false);
cin>>i;
while(i--) {
cin>>n>>d>>e;
m=n-d*e+2;
i=m*m-4*n;
si=sqrt(i);
if(si*si!=i) {
cout<<"NO"<<endl;
continue;
}
if((m+si)%2==1||m<=si) {
cout<<"NO"<<endl;
continue;
}
cout<<(m-si)/2<<' '<<(m+si)/2<<endl;
}
return 0;
}