| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 357 | 170 | 152 | 55.882% |
Let $s$ be an arithmetic sequence consisting of 2ドルn$ integers, where the first term is denoted as $a$ and the common difference as $b$. In other words, $s = [a, a+b, a+2b, \ldots, a+(2n-1)b]$.
You should perform a sequence of $n$ operations, where each operation involves selecting two coprime integers from $s$ and erasing them. Once an integer is erased from $s,ドル it cannot be selected again for any subsequent operations.
Find any sequence of operations satisfying the above conditions, or report that such a sequence does not exist.
The first line contains three integers $n, a, b$. (1ドル \leq n \leq 10^5,ドル 1ドル \leq a, b \leq 10^9$)
If no such sequence of operations exists, print No.
Otherwise, print Yes, followed by $n$ lines. On each line, print the two integers selected from $s$ for the corresponding operation.
If there are multiple possible answers, you may print any.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 50 | $b=1$ |
| 2 | 50 | No further constraints |
2 1 1
Yes 1 4 2 3
4 4 6
No
3 995069485 940582184
Yes 3816816037 4757398221 5697980405 1935651669 2876233853 995069485
Two integers are said to be coprime if the only positive integer that divides both of them is 1ドル$.