Relatively Prime Pairs
You are given a set of all integers from l to r inclusive (r - l is odd).You want to split these numbers into exactly (r-l+1)/2 pairs in such a way that for each pair (i,j), the greates common divisor of i and j is equal to 1. Each pair should appear in exactly one of the pairs. Print the resulting pairs or output that no solution exists.
1 <= l, r, <= 10^8 r-l+1 <= 10^5 and r-l is odd
The only line contains two integer l and r.
If any solution exists, print "YES" in the first line. Each of next (r-l+1)/2 line contains some pair of integers. GCD of each pair of integers should be equal to 1. If there exists no solution print "NO".
YES 1 2 3 4 5 6 7 8