## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] Difference of GCDs Codeforces Solution

B. Difference of GCDs
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given three integers $n$$l$, and $r$. You need to construct an array ${a}_{1},{a}_{2},\dots ,{a}_{n}$ ($l\le {a}_{i}\le r$) such that $gcd\left(i,{a}_{i}\right)$ are all distinct or report there's no solution.

Here $gcd\left(x,y\right)$ denotes the greatest common divisor (GCD) of integers $x$ and $y$.

Input

The input consists of multiple test cases. The first line contains a single integer $t$ ($1\le t\le {10}^{4}$) — the number of test cases. The description of the test cases follows.

The first line contains three integers $n$$l$$r$ ($1\le n\le {10}^{5}$$1\le l\le r\le {10}^{9}$).

Solution Click Below:-  👉
👇👇👇👇👇

It is guaranteed that the sum of $n$ over all test cases does not exceed ${10}^{5}$.

Output

For each test case, if there is no solution, print "NO" (without quotes). You can print letters in any case (upper or lower).

Difference Operations Codeforces Solution

Difference of GCDs Codeforces Solution

Doremy's IQ Codeforces Solution

Difference Array Solution Codeforces

Partial Virtual Trees Codeforces Solution

DFS Trees Codeforces Solution

Otherwise, print "YES" (without quotes). In the next line, print $n$ integers ${a}_{1},{a}_{2},\dots ,{a}_{n}$ — the array you construct.

If there are multiple solutions, you may output any.