#include using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, s, n) for (ll i = s; i <= (ll)(n); i++) #define rep3(i, s, n, d) for (ll i = s; i <= (ll)(n); i += d) #define rep4(i, s, n, d) for (ll i = s; i >= (ll)(n); i += d) typedef long long ll; typedef long double ld; typedef vector vi; typedef vector vvi; typedef vector vvvi; typedef vector vvvvi; typedef vector vs; typedef vector vvs; typedef vector vvvs; typedef vector vc; typedef vector vvc; typedef vector vvvc; typedef vector vll; typedef vector vvll; typedef vector vvvll; typedef vector vvvvll; typedef vector vvvvvll; typedef vector vd; typedef vector vvd; typedef vector vvvd; typedef vector vld; typedef vector vvld; typedef vector vvvld; typedef vector vb; typedef vector vvb; typedef vector vvvb; typedef vector> vpi; typedef vector> vpll; typedef priority_queue, greater> pqi; typedef priority_queue, greater> pqvi; typedef priority_queue, greater> pqll; typedef priority_queue, greater> pqvll; typedef priority_queue, less> rpqi; typedef priority_queue, less> rpqvi; typedef pair P; #define yes(ans) if(ans)cout << "yes"<< endl; else cout << "no" << endl #define Yes(ans) if(ans)cout << "Yes"<< endl; else cout << "No" << endl #define YES(ans) if(ans)cout << "YES"<< endl ;else cout << "NO" << endl #define printv(vec) rep(i, vec.size()) cout << vec[i] << ' '; #define printvv(vec) rep(i, vec.size()) {rep(j, vec[i].size()) cout << vec[i][j] << ' '; cout << endl;}; #define printvvv(vec) rep(i, vec.size()) { rep(j, vec[i].size()) { rep(k, vec[i][j].size()) cout << vec[i][j][k] << ' '; cout << " "; }cout << endl; }; #define all1(x) x.begin(),x.end() #define all2(x) x.rbegin(), x.rend() #define so(x) sort(all1(x)) #define re(x) reverse(all1(x)) #define rso(x) sort(all2(x)) #define vco(x, a) count(all1(x), a) #define per(x) next_permutation(all1(x)) #define iINF 2147483647 #define llINF 9223372036854775807 #define mod 998244353 #define mod2 1000000007 int main() { int q; cin >> q; while (q--) { int d, k; cin >> d >> k; if (d == 0 && k == 1) cout << "Yes" << endl << 0 << ' ' << 0 << endl; else if (k > 4 * d) cout << "No" << endl; else if (d == 1) { cout << "Yes" << endl; cout << 0 << ' ' << 1 << endl; } else { cout << "Yes" << endl; int t = 0, x = d / 2; if (d % 2 == 0) t = 4; else t = 8; bool p = true; rep3(i, t, 4 * d, 8) { //cout << i << ' '; if (k <= i) { cout << x << ' ' << d - x << endl; p = false; break; } x--; } if (p) cout << 0 << ' ' << d << endl; } } }