CF1051B.Relatively Prime Pairs

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Relatively Prime Pairs

You are given a set of all integers from ll to rr inclusive, l<rl \lt r, (rl+1)3105(r - l + 1) \le 3 \cdot 10^5 and (rl)(r - l) is always odd.

You want to split these numbers into exactly rl+12\frac{r - l + 1}{2} pairs in such a way that for each pair (i,j)(i, j) the greatest common divisor of ii and jj is equal to 11. Each number should appear in exactly one of the pairs.

Print the resulting pairs or output that no solution exists. If there are multiple solutions, print any of them.

Input

The only line contains two integers ll and rr (1l<r10181 \le l \lt r \le 10^{18}, rl+13105r - l + 1 \le 3 \cdot 10^5, (rl)(r - l) is odd).

Output

If any solution exists, print "YES" in the first line. Each of the next rl+12\frac{r - l + 1}{2} lines should contain some pair of integers. GCD of numbers in each pair should be equal to 11. All (rl+1)(r - l + 1) numbers should be pairwise distinct and should have values from ll to rr inclusive.

If there are multiple solutions, print any of them.

If there exists no solution, print "NO".

Samples

1 8
YES
2 7
4 1
3 8
6 5

在线编程 IDE

建议全屏模式获得最佳体验