#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int MAXN = (int)1e5 + 10;
const int mo = (int)1e9 + 7;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int b, w;
    cin >> b >> w;
    if (b > 3 * w + 1 || w > 3 * b + 1) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    if (b >= w) {
      if (b == 3 * w + 1) cout << 2 << " " << w * 2 + 1 << "\n", b--;
      for (int i = 1; i <= w; i++) {
        cout << 2 << " " << i * 2 << "\n";
        cout << 2 << " " << i * 2 - 1 << "\n";
      }
      b = b - w;
      int tag = 1;
      while (true) {
        if (tag == 1) {
          if (b)
            cout << 1 << " " << 2 * tag << "\n";
          else
            break;
          b--;
          if (b)
            cout << 3 << " " << 2 * tag << "\n";
          else
            break;
          b--;
        } else {
          if (b)
            cout << 1 << " " << 2 * tag << "\n";
          else
            break;
          b--;
          if (b)
            cout << 3 << " " << 2 * tag << "\n";
          else
            break;
          b--;
        }
        tag++;
      }
    } else {
      if (w == 3 * b + 1) cout << 2 << " " << b * 2 + 2 << "\n", w--;
      for (int i = 1; i <= b; i++) {
        cout << 2 << " " << i * 2 + 1 << "\n";
        cout << 2 << " " << i * 2 << "\n";
      }
      w = w - b;
      int tag = 1;
      while (true) {
        if (tag == 1) {
          if (w)
            cout << 1 << " " << 2 * tag + 1 << "\n";
          else
            break;
          w--;
          if (w)
            cout << 3 << " " << 2 * tag + 1 << "\n";
          else
            break;
          w--;
        } else {
          if (w)
            cout << 1 << " " << 2 * tag + 1 << "\n";
          else
            break;
          w--;
          if (w)
            cout << 3 << " " << 2 * tag + 1 << "\n";
          else
            break;
          w--;
        }
        tag++;
      }
    }
  }
  return 0;
}
