#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int b, w;
    cin >> b >> w;
    int contX = 2;
    int contY = 2;
    if (b > w) contX++;
    vector<pair<int, int> > blancos;
    vector<pair<int, int> > negros;
    while (true) {
      if ((contX + contY) % 2 == 0 && w == 0)
        break;
      else if ((contX + contY) % 2 != 0 && b == 0)
        break;
      if ((contX + contY) % 2 == 0)
        blancos.push_back({contX, contY}), w--;
      else
        negros.push_back({contX, contY}), b--;
      contX++;
    }
    if (b != 0) {
      for (int i = 0; i < blancos.size(); i++) {
        if (b == 0) break;
        b--;
        negros.push_back({blancos[i].first, blancos[i].second - 1});
        if (b == 0) break;
        b--;
        negros.push_back({blancos[i].first, blancos[i].second + 1});
      }
    } else {
      for (int i = 0; i < negros.size(); i++) {
        if (w == 0) break;
        w--;
        blancos.push_back({negros[i].first, negros[i].second - 1});
        if (w == 0) break;
        w--;
        blancos.push_back({negros[i].first, negros[i].second + 1});
      }
    }
    if (b != 0 || w != 0)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 0; i < blancos.size(); i++)
        cout << blancos[i].first << " " << blancos[i].second << endl;
      for (int i = 0; i < negros.size(); i++)
        cout << negros[i].first << " " << negros[i].second << endl;
    }
  }
  return 0;
}
