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