Universal Cup Judging System

Universal Cup

حد الوقت: 6 s حد الذاكرة: 1024 MB مجموع النقاط: 100 الصعوبة: [عرض] تفاعلية
الإحصائيات

This is an interactive problem.

In the Plang Province, $n = 300$ students just participated in Plang OI 2026. Among them, some won gold medals while others did not.

Students in Plang Province have a strange habit. If they didn't win gold medal, they will honestly say that they haven't won. However, if they have won, they will say they have won with $\frac{1}{2}$ probability, while the other $\frac{1}{2}$ probability is that they say they haven't. Note that each response is random and has no relation to the previous one.

You, as the coach of Plang Province, want to know for each student whether they have won gold. Then you can let Una perform the following actions:

  • Choose some distinct students and ask Una to ask each of them whether they have won the gold medal. Una will tell you the number of people who answered "Yes".

The gold medal line of Plang OI 2025 is 571, so you should find the answer in no more than 568 queries on average.

Due to the limitations of the Plang OI, you may assume that there're exactly 48 students won gold medal.

problem_14978_4.png

Picture 1: A coach asking a student how many points he has hidden.

Interaction Protocol

This is an interactive problem. Remember to flush the output buffer after every print. To flush your output, you can use:

  • fflush(stdout) or cout.flush() in C/C++;
  • System.out.flush() in Java and Kotlin;
  • sys.stdout.flush() in Python.

First, you should read an integer $T$ ($T = 20$) indicating the number of test cases.

For each test case, you should read an integer $n$ ($n = 300$), indicating the number of students.

To make a query, you should output one line formatted as "? $k$ $p_1$ $p_2$ ... $p_k$" ($1 \le p_i \le n$, $p_i \ne p_j$ for $1 \le i < j \le k$).

Then, read an integer indicating the answer Una found. If your query is invalid, or if you make more than $568T$ queries in total, the jury program will output $-1$. After reading $-1$, you should exit immediately to avoid undefined behavior.

If you get the answer, you should output one line formatted as "! $s_1s_2\dots s_n$", where $s_i = 1$ indicating the $i$-th student get gold, 0 otherwise.

Then, read one word OK or WA indicating whether your answer is correct. If your program reads WA, you should exit immediately to avoid undefined behavior.

Note that the grader is not adaptive, that is the answer won't change after your queries. There are at most 10 tests.

Example

Input

1
2
0
0
1
OK

Output

? 2 1 2
? 1 1
? 1 2
! 01

Note

Note that the example is for reference only, it does not satisfy $T = 20$ and $n = 300$, and it will not appear in the final tests.

A testing tool is provided to help contestants develop and test their solutions. You can download this tool from the attachments. Executing the tool with a -h option should describe how to use the tool. The testing tool will only implement some test scenarios and only some functionality of the real judge program.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.