#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
int x[500005];
int l[500005];
int r[500005];
int u[500005];
int d[500005];
signed main() {
  int q, n, k;
  scanf("%d", &q);
  while (q--) {
    int b, w;
    scanf("%d%d", &b, &w);
    if (b < w) {
      int dd = w - b;
      if (dd > 2 * b + 1) {
        printf("NO\n");
      } else {
        printf("YES\n");
        for (int i = 2; i <= 2 * b + 1; i++) {
          printf("%d 1000\n", i);
        }
        for (int i = 3; i <= 2 * b + 1; i += 2) {
          if (dd != 0) {
            printf("%d 999\n", i);
            dd--;
          }
          if (dd != 0) {
            printf("%d 1001\n", i);
            dd--;
          }
        }
        if (dd != 0) {
          printf("%d 1000\n", 2 * b + 2);
        }
      }
    } else {
      int dd = b - w;
      if (dd > 2 * w + 1) {
        printf("NO\n");
      } else {
        printf("YES\n");
        for (int i = 2; i <= 2 * w + 1; i++) {
          printf("%d 1000\n", i);
        }
        for (int i = 2; i <= 2 * w + 1; i += 2) {
          if (dd != 0) {
            printf("%d 999\n", i);
            dd--;
          }
          if (dd != 0) {
            printf("%d 1001\n", i);
            dd--;
          }
        }
        if (dd != 0) {
          printf("%d 1000\n", 1);
        }
      }
    }
  }
  return 0;
}
