|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||256 MB||0||0||0||0.000%|
There is an array a of length n, consisting of distinct integers. It is guaranteed that every element of the array is a positive integer less than or equal to 109. You have to find out the values of all the elements of it.
To do so, you can make up to 30 queries of the following two types:
Once you know the answer, print it using the following query:
At the beginning, your program should read one integer n (1 ≤ n ≤ 250) — the number of elements.
In order to make a query of the first type, print “1 i” (1 ≤ i ≤ n). After this query, read one integer — the value of ai.
In order to make a query of the second type, print “2 k” (2 ≤ k ≤ n). Then in the same line print k space-separated distinct integers — i1, i2, . . . , ik, (1 ≤ ij ≤ n). After this query read k·(k−1)/2 integers — |aic − aid| for every c < d. These values will be given in random order.
Once you know the answer, print “3”. Then in the same line, print n space-separated integers — a1, a2, . . . , an (1 ≤ ai ≤ 109). Your program must terminate after this query.
If for either of two first queries you get one number −1 as the answer, then it means that you made more queries than allowed, or made an invalid query. Your program should immediately terminate (for example, by calling
exit(0)). You will receive “
Wrong Answer”. If you ignore this, you can get other verdicts since your program will continue to read from a closed stream.
After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Wall
time-limit exceeded. To do this, use:
Precisely follow this format of interaction
3 1 2 4 3 1
1 1 1 2 2 3 1 2 3 3 1 2 5
In the first query of type 1, we ask the value of a1 and receive 1 as the answer.
In the second query of type 2, we ask the value of a2 and receive 2 as the answer.
In the query of type 2, we ask all the possible differences between the elements of array with indexes 1, 2 and 3. And we get array 4, 3, 1 as the result. We know that the array contains values |a1−a2|, |a1−a3|, |a2−a3|. Since we already know that |a2 − a1| = 1, one of the following is true: |a1 − a3| = 3 and |a2 − a3| = 4 or |a2 − a3| = 3 and |a1 − a3| = 4. The only case that is possible, taking into account the constraints of the problem, is when |a1 − a3| = 4 and |a2 − a3| = 3 with a3 = 5.
Since we know the values of all the elements of the array, we print them in the last query.