#include #include using namespace std; int main() { int Q; cin >> Q; for (int i = 0; i < Q; i++) { int D, K; cin >> D >> K; bool found = false; for (int x = 0; x <= D; x++) { int y = sqrt(D * D - x * x); if (x * x + y * y == D * D && x + y <= K) { cout << "Yes\n" << x << " " << y << endl; found = true; break; } } if (!found) { cout << "No" << endl; } } return 0; }