- Time limit: 1.00 s
- Memory limit: 512 MB
There is a hidden permutation of integers . Your task is to find this permutation.
To do this, you can ask questions: you can choose two indices and and you will be told if .
Interaction
This is an interactive problem. Your code will interact with the grader using standard input and output. You should start by reading a single integer : the length of the permutation.
On your turn, you can print one of the following:
- "", where : ask if . The grader will return
YES
if andNO
otherwise. - "": report that the hidden permutation is . Your program must terminate after this.
Each line should be followed by a line break. You must make sure the output gets flushed after printing each line.
Constraints
- you can ask at most questions of type
Example
3 ? 3 2 NO ? 3 1 YES ! 3 1 2
Explanation: The hidden permutation is . The first question asks if which is false, so the answer is NO
. The second question asks if which is true, so the answer is YES
.