#include <bits/stdc++.h>
using namespace std;
long long k, n, e, d, p, q, a, b;
int main() {
freopen("csp2022pj_decode.in","r",stdin);
freopen("csp2022pj_decode.out","w",stdout);
cin >> k;
while(k--) {
cin >> n >> e >> d;
a = n + 2 - e*d;
b = sqrt(a*a - 4*n);
p = (a + b) / 2;
q = a - p;
if(p*q == n) {
if(p > q) swap(p, q);
cout << p << " " << q << endl;
}
else {
cout << "NO" << endl;
}
}
return 0;
}