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