#P1299E. So Mean
So Mean
No submission language available for this problem.
Description
This problem is interactive.
We have hidden a permutation of numbers from to from you, where is even. You can try to guess it using the following queries:
.
In response, you will learn if the average of elements with indexes is an integer. In other words, you will receive if is integer, and otherwise.
You have to guess the permutation. You can ask not more than queries.
Note that permutations and are indistinguishable. Therefore, you are guaranteed that .
Note that the permutation is fixed before the start of the interaction and doesn't depend on your queries. In other words, interactor is not adaptive.
Note that you don't have to minimize the number of queries.
The first line contains a single integer (, is even).
Interaction
You begin the interaction by reading .
To ask a question about elements on positions , in a separate line output
...
Numbers in the query have to satisfy , and all have to be different. Don't forget to 'flush', to get the answer.
In response, you will receive if is integer, and otherwise.
In case your query is invalid or you asked more than queries, the program will print and will finish interaction. You will receive a Wrong answer verdict. Make sure to exit immediately to avoid getting other verdicts.
When you determine permutation, output
...
After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:
- fflush(stdout) or cout.flush() in C++;
- System.out.flush() in Java;
- flush(output) in Pascal;
- stdout.flush() in Python;
- see documentation for other languages.
Hack format
For the hacks use the following format:
The first line has to contain a single integer (, is even).
In the next line output integers — the valid permutation of numbers from to . must hold.
Input
The first line contains a single integer (, is even).