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