#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long b, w;
    cin >> b >> w;
    long long mi = min(b, w);
    long long ma = max(b, w);
    if (3 * mi + 1 < ma) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    if (w <= b) {
      for (long long i = 1; i <= w; i++) {
        cout << "2 " << 2 * i << '\n';
        cout << "2 " << 2 * i + 1 << '\n';
      }
      b -= w;
      if (b != 0) {
        cout << "2 1\n";
        b--;
      }
      long long i = 1;
      while (b != 0) {
        cout << "1 " << 2 * i << '\n';
        b--;
        if (b == 0) break;
        cout << "3 " << 2 * i << '\n';
        b--;
        i++;
      }
    } else {
      b = w ^ b;
      w = w ^ b;
      b = w ^ b;
      for (long long i = 1; i <= w; i++) {
        cout << "3 " << 2 * i << '\n';
        cout << "3 " << 2 * i + 1 << '\n';
      }
      b -= w;
      if (b != 0) {
        cout << "3 1\n";
        b--;
      }
      long long i = 1;
      while (b != 0) {
        cout << "2 " << 2 * i << '\n';
        b--;
        if (b == 0) break;
        cout << "4 " << 2 * i << '\n';
        b--;
        i++;
      }
    }
  }
  return 0;
}
