#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long long b, w;
    cin >> b >> w;
    long long ans[b + w];
    long long num = 0;
    long long mx = max(b, w);
    long long mn = min(b, w);
    if (mn * 3 + 1 < mx) {
      cout << "NO" << '\n';
    } else {
      long long cnt = 0;
      cout << "YES" << '\n';
      if (b >= w) {
        long long x = 2, y = 2;
        long long a = w;
        long long c = b;
        while (a > 0) {
          cout << x << ' ' << y << '\n';
          x += 2;
          a--;
        }
        x = 1, y = 2;
        while (c > 0 && x <= 2 * w + 1) {
          cout << x << ' ' << y << '\n';
          x += 2;
          c--;
        }
        x = 2;
        while (c > 0 && x <= 2 * b + 1) {
          cout << x << ' ' << y + 1 << '\n';
          c--;
          if (c == 0) break;
          cout << x << ' ' << y - 1 << '\n';
          c--;
          x += 2;
        }
      } else {
        long long x = 2, y = 3;
        long long a = b;
        long long c = w;
        while (a > 0) {
          cout << x << ' ' << y << '\n';
          x += 2;
          a--;
        }
        x = 1, y = 3;
        while (c > 0 && x <= 2 * b + 1) {
          cout << x << ' ' << y << '\n';
          x += 2;
          c--;
        }
        x = 2;
        while (c > 0 && x <= 2 * b + 1) {
          cout << x << ' ' << y + 1 << '\n';
          c--;
          if (c == 0) break;
          cout << x << ' ' << y - 1 << '\n';
          c--;
          x += 2;
        }
      }
    }
  }
}
