This is an interactive problem. Your program will interact with the judge using standard input and output.
You are given an array $$$a$$$ of $$$n$$$ positive integers and an integer $$$k$$$, where $$$2k \leq n$$$. You have an initial score equal to $$$0$$$.
You will be asked $$$k$$$ queries. For each query, you will be given an integer $$$x \in \{1, 2\}$$$. You must choose an index $$$i$$$ ($$$1 \leq i \leq n$$$) such that$$$^\dagger$$$:
Whenever you choose some index $$$i$$$ in some query, the value of $$$a_i$$$ is added to the score.
Your task is to maximize the score after completing all $$$k$$$ queries.
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$2 \le 2k \le n \le 10^5$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^9$$$).
The interaction proceeds as follows for $$$k$$$ times:
If your program makes an invalid response, then the judge's response will be "0". After receiving such a response, your program should immediately terminate to receive the verdict Wrong Answer. Otherwise, it may receive any other verdict.
After responding to a query, do not forget to output the end of the line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:
6 3 5 1 3 4 2 6 1 1 1 1 2 1
1 6 4
Sample explanation:
The size of the array is 6 and there are 3 queries. The first 2 lines describe the array and the number of queries.
In the first query, we must choose an index divisible by $$$1$$$, we choose the index $$$1$$$ and since it's divisible by $$$1$$$ and has not been chosen before, the judge will print $$$1$$$ to confirm that the chosen index is valid.
In the second query, we must choose an index divisible by $$$1$$$, we choose the index $$$6$$$ and since it's divisible by $$$1$$$ and has not been chosen before, the judge will print $$$1$$$ to confirm that the chosen index is valid. Note that if we chose $$$1$$$ instead the judge will print $$$0$$$ (since it has been chosen before).
In the third query, we must choose an index divisible by $$$2$$$, we choose the index $$$4$$$ and since it's divisible by $$$2$$$ and has not been chosen before, the judge will print $$$1$$$ to confirm that the chosen index is valid. Note that if we chose $$$6$$$ instead the judge will print $$$0$$$ (since it has been chosen before), and if we chose $$$3$$$ the judge will also print $$$0$$$ (since it's not divisible by $$$2$$$).
Note that over all combinations of: two indices divisible by 1 and one index divisible by 2, the maximum possible result is 15 (which is equal to the result in the example) and all chosen indices are distinct and satisfy the divisibility condition, so the result is considered correct.
| Название |
|---|


