#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> houren; while(houren--){ int d,k; cin >> d >> k; if(d==0){ if(k==1) cout << "Yes\n0 0\n"; else cout << "No\n"; }else{ if(k<=d*4){ cout << "Yes\n"; int x = (k+3)/8; if(d&1) x = (k-1)/8; else x = (k+3)/8; cout << d/2+x << " " << (d+1)/2-x << '\n'; }else cout << "No\n"; } } return 0; }