Road Network
시간 제한: 1000ms메모리 제한: 2048MB출처: EIO 2023-24 sel2BOJ 33134
문제
There are cities and two-way roads in Potokoland. The cities are numbered from to . The roads are also numbered from to . The road number connects cities and , where is the remainder from dividing by .
Determine if it is possible to travel from any city to any other city using the roads. If not, find a pair of cities that are not connected.
입력
The first line contains (), the number of cities in Potokoland.
출력
Output the word 'YES' if it is possible to travel from any city to any other city.
Otherwise, output the word 'NO' on the first line. On the second line, output any two cities and (; ) such that it is impossible to travel from to using the roads. If there are several possible answers, output any one of them.
예제
예제 1
입력
4
출력
NO 0 1
예제 2
입력
6
출력
YES
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.