#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int b, w;
    cin >> b >> w;
    if (b > 3 * w + 1 || w > 3 * b + 1) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    int sx = 2, sy = 3;
    if (b > w) {
      ++sx;
      swap(b, w);
    }
    for (int i = 0; i < 2 * b; i++) cout << sx << " " << sy + i << endl;
    w -= b;
    if (w > 0) {
      cout << sx << " " << sy - 1 << endl;
      --w;
    }
    for (int i = 0; i < b && w > 0; i++) {
      cout << sx - 1 << " " << sy + i * 2 << endl;
      --w;
    }
    for (int i = 0; i < b && w > 0; i++) {
      cout << sx + 1 << " " << sy + i * 2 << endl;
      --w;
    }
  }
}
