Logo
(追記) (追記ここまで)

28053번 - Simple Game 서브태스크스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB35717015255.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.

제한

서브태스크

번호배점제한
150

$b=1$

250

No further constraints

예제 입력 1

2 1 1

예제 출력 1

Yes
1 4
2 3

예제 입력 2

4 4 6

예제 출력 2

No

예제 입력 3

3 995069485 940582184

예제 출력 3

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ドル$.

출처

University > KAIST > KAIST RUN Spring Contest > 2023 KAIST RUN Spring Contest A번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /