#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long int a, b, c, d, e, f, g, w, h[100005], arr[100005];
string s;
vector<long long int> v;
char ch;
int main() {
  cin >> g;
  while (g--) {
    cin >> b >> w;
    long long int aw = 1;
    if (b >= w) {
      long long int tut1 = b, tut2 = w, say = 1;
      if (b > w * 3 + 1) {
        cout << "NO" << endl;
        continue;
      }
      cout << "YES" << endl;
      while (b and w) {
        cout << 2 << ' ' << say << endl;
        if (say % 2 == 1) {
          b--;
          if (b == 0) {
            say++;
            cout << 2 << ' ' << say << endl;
            w--;
          }
        } else {
          w--;
          if (w == 0) {
            say++;
            cout << 2 << ' ' << say << endl;
            b--;
          }
        }
        say++;
      }
      long long int ss = 2;
      while (b and ss < say) {
        if (b == 1) {
          cout << 1 << ' ' << ss << endl;
          b--;
        } else {
          cout << 1 << ' ' << ss << endl;
          cout << 3 << ' ' << ss << endl;
          b -= 2;
        }
        ss += 2;
      }
    } else {
      long long int tut1 = b, tut2 = w, say = 1;
      if (w > b * 3 + 1) {
        cout << "NO" << endl;
        continue;
      }
      cout << "YES" << endl;
      while (b and w) {
        cout << 3 << ' ' << say << endl;
        if (say % 2 == 1) {
          w--;
        } else {
          b--;
          if (b == 0) {
            say++;
            cout << 3 << ' ' << say << endl;
            w--;
          }
        }
        say++;
      }
      long long int ss = 2;
      while (w and ss < say) {
        if (w == 1) {
          cout << 2 << ' ' << ss << endl;
          w--;
        } else {
          cout << 2 << ' ' << ss << endl;
          cout << 4 << ' ' << ss << endl;
          w -= 2;
        }
        ss += 2;
      }
    }
  }
}
