Points Construction Problem
题号:NC209386
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Imagine you have an infinite 2D plane with Cartesian coordinate system. Initially, all the integral points are painted as white. You are given two integers n, and m. Please paint exactly n integral points to black such that there are exactly m pairs of points which satisfy the following conditions:

1. The two points are colored by different colors.

2. the two points are adjacent. We call two integral points (x_1, y_1) and (x_2, y_2) being adjacent if and only if . (|v| means the absolute value of v.)

3. The x and y coordinates of all black points are in the range .

输入描述:

The first line contains one integer t () --- the number of test cases.

The only line of each test case contains two integers n and m ().

输出描述:

For each test, if there exists at least one configuration to choose n points to satisfy the conditions given by statement, you should print n+1 line for this test. The first line contains one string "Yes". And the following n lines contain the coordinator of these n points which is colored as black. If there are no solution, please print one line containing only one string "No".
示例1

输入

复制
6
5 20
1 2
1 3
1 4
1 5
3 8

输出

复制
Yes
1 1
2 2
3 3
4 4
5 5
No
No
Yes
1 1
No
Yes
1 1
1 2
2 1

说明

In the first test and fourth test, each black point in the sample output is adjacent to exactly 4 white points.
In the sixth test, the second and third black points in the sample output are both adjacent to 3 white points and the forst black point is adjacent to 2 white points.