#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, b, w, i, j, x, y, sc, r, c;
  long long t;
  cin >> t;
  while (t--) {
    cin >> b >> w;
    r = 3;
    sc = 3;
    if (w > b) {
      swap(b, w);
      sc++;
    }
    if (b < w - 1 || b > 3 * w + 1) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    c = sc;
    i = w;
    while (i--) {
      cout << r << " " << c << "\n";
      c += 2;
    }
    c = sc + 1;
    i = w - 1;
    while (i--) {
      cout << r << " " << c << "\n";
      c += 2;
    }
    b = b - w + 1;
    c = sc;
    i = w;
    while (b > 0 && i--) {
      cout << r - 1 << " " << c << "\n";
      c += 2;
      b--;
    }
    c = sc;
    i = w;
    while (b > 0 && i--) {
      cout << r + 1 << " " << c << "\n";
      c += 2;
      b--;
    }
    if (b > 0) {
      cout << r << " " << sc - 1 << "\n";
      b--;
    }
    if (b > 0) {
      cout << r << " " << sc + 2 * w - 1 << "\n";
      b--;
    }
  }
  return 0;
}
