#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll k,d,e,n;
ll m;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL),cout.tie(NULL);
cin>>k;
while(k--){
cin>>n>>d>>e;
m=n-d*e+2;
double p=(m-1.0*sqrt(m*m-4*n))/2.0;
ll p1=p;
ll q=m-p;
if(m*m-4*n<0||p1!=p||p1*q!=n) puts("NO");
else cout<<p1<<" "<<q<<endl;
}
return 0;
}