#include <bits/stdc++.h>
using namespace std;
long long k, e, d, m, ans = 0, n;
int main() {
freopen("csp2022pj_decode.in", "r", stdin);
freopen("csp2022pj_decode.out", "w", stdout);
cin >> k;
for (int tt = 1; tt <= k; tt++) {
cin >> n >> e >> d;
m = n - e * d + 2;
long long qm = sqrt(m * m - 4 * n);
if (m * m - 4 * n < 0 || sqrt(m * m - 4 * n) != qm) {
cout << "NO" << endl;
continue;
}
long long p, q;
p = -m + qm;
if (p % 2 != 0) {
cout << "NO" << endl;
continue;
}
p /= -2;
q = m - p;
if (p > q)
swap(p, q);
cout << p << ' ' << q << endl;
}
return 0;
}