#include <bits/stdc++.h>
using namespace std;
long long a[200005][3];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    long long b, w, i, j, k, x, y;
    cin >> b >> w;
    x = fmin(b, w);
    y = fmax(b, w);
    if (y > 3 * x + 1) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    if (w >= b) {
      k = w;
      w = b;
      b = k;
      j = 3;
      for (i = 0; i < w; i++) {
        cout << j << " 2\n";
        j += 2;
      }
      k = j;
      j = 2;
      for (i = 0; i < w; i++) {
        cout << j << " 2\n";
        b--;
        j += 2;
      }
      if (b) {
        cout << j << " 2\n";
        b--;
      }
      i = 3;
      while (b > 0 && i < k) {
        cout << i << " 1\n";
        b--;
        i += 2;
      }
      i = 3;
      while (b > 0 && i < k) {
        cout << i << " 3\n";
        b--;
        i += 2;
      }
    } else {
      j = 3;
      for (i = 0; i < w; i++) {
        cout << j << " 3\n";
        j += 2;
      }
      k = j;
      j = 2;
      for (i = 0; i < w; i++) {
        cout << j << " 3\n";
        b--;
        j += 2;
      }
      if (b) {
        cout << j << " 3\n";
        b--;
      }
      i = 3;
      while (b > 0 && i < k) {
        cout << i << " 2\n";
        b--;
        i += 2;
      }
      i = 3;
      while (b > 0 && i < k) {
        cout << i << " 4\n";
        b--;
        i += 2;
      }
    }
  }
  return 0;
}
