Simple Game
면접 대비시간 제한1초메모리 제한1024 MB
등차수열의 2n개 항을 서로소인 정수 n쌍으로 짝지어 출력하거나, 불가능하면 No를 출력한다.
문제
Let be an arithmetic sequence consisting of integers, where the first term is denoted as and the common difference as . In other words, .
You should perform a sequence of operations, where each operation involves selecting two coprime integers from and erasing them. Once an integer is erased from , 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 . (, )
출력
If no such sequence of operations exists, print No.
Otherwise, print Yes, followed by lines. On each line, print the two integers selected from for the corresponding operation.
If there are multiple possible answers, you may print any.
힌트
Two integers are said to be coprime if the only positive integer that divides both of them is .