408403: GYM103114 G Guess Permutation
Description
This is an interactive problem.
$$$Kwords$$$ has a permutation $$$a_1,a_2,...,a_n$$$ of $$$1$$$ to $$$n$$$, now you can ask him no more than $$$10$$$ questions to guess the permutation.
For each query, you can give him a set $$$s$$$ of $$$k(1\leq k\leq n)$$$ indexes, he will give you a sorted array of $$$[a_{s_1}, a_{s_2},...,a_{s_{k}}]$$$.
$$$Kwords$$$ thinks the problem is very interesting and invites you to solve it with him.
InputThe first line contains a single integer $$$n(1\leq n\leq 1000)$$$.
OutputWhen you are ready to answer, print a single line of the form "! $$$a_1$$$ $$$a_2$$$ $$$…$$$ $$$a_n$$$" $$$(1\leq a_i \leq n)$$$, where $$$a$$$ is a permutation.
InteractionWhen you are ready to query, print a single line of the form "$$$k$$$ $$$s_1$$$ $$$s_2$$$ $$$…$$$ $$$s_k$$$" $$$(1\leq k,s_i\leq n)$$$.
After printing a line, do not forget to 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;
- stdout.flush() in Python;
You will get Wrong answer if you ask more than $$$10$$$ questions.
ExampleInput4 1 3 2 3Output
2 1 2 2 1 3 ! 3 1 2 4