#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int b, w;
    cin >> b >> w;
    if (w >= b) {
      if (w > (3 * b + 1))
        cout << "NO" << endl;
      else {
        cout << "YES" << endl;
        for (int i = 1; i <= b; ++i) cout << (2 * i) << " " << 3 << endl;
        if (w == b || w == (b + 1)) {
          for (int i = 0; i < w; ++i) cout << ((2 * i) + 1) << " " << 3 << endl;
        } else {
          for (int i = 0; i < (b + 1); ++i)
            cout << ((2 * i) + 1) << " " << 3 << endl;
          for (int i = 1; i <= (w - b - 1); ++i) {
            if (i <= b) cout << (2 * i) << " " << 2 << endl;
            if (i > b) cout << (2 * (i - b)) << " " << 4 << endl;
          }
        }
      }
    }
    if (b > w) {
      if (b > (3 * w + 1))
        cout << "NO" << endl;
      else {
        cout << "YES" << endl;
        for (int i = 1; i <= w; ++i) cout << (2 * i) << " " << 2 << endl;
        if (b == (w + 1)) {
          for (int i = 0; i < b; ++i) cout << ((2 * i) + 1) << " " << 2 << endl;
        } else {
          for (int i = 0; i <= w; ++i) cout << (2 * i + 1) << " " << 2 << endl;
          for (int i = 1; i <= (b - w - 1); ++i) {
            if (i <= w) cout << (2 * i) << " " << 1 << endl;
            if (i > w) cout << (2 * (i - w)) << " " << 3 << endl;
          }
        }
      }
    }
  }
}
