English · Original
Chinese · Translation
Formal · Original
_Pay attention: this problem is interactive._
Penguin Xoriy came up with a new game recently. He has _n_ icicles numbered from 1 to _n_. Each icicle has a temperature — an integer from 1 to 109. **Exactly two** of these icicles are special: their temperature is _y_, while a temperature of all the others is _x_ ≠ _y_. You have to find those special icicles. You can choose a _non-empty_ subset of icicles and ask the penguin what is the bitwise exclusive OR (_XOR_) of the temperatures of the icicles in this subset. Note that you can't ask more than **19** questions.
You are to find the special icicles.
## Input
The first line contains three integers _n_, _x_, _y_ (2 ≤ _n_ ≤ 1000, 1 ≤ _x_, _y_ ≤ 109, _x_ ≠ _y_) — the number of icicles, the temperature of non-special icicles and the temperature of the special icicles.
## Output
To give your answer to the penguin you have to print character "!" (without quotes), then print two integers _p_1, _p_2 (_p_1 < _p_2) — the indexes of the special icicles **in ascending order**. Note that "!" and _p_1 should be separated by a space; the indexes should be separated by a space too. After you gave the answer your program should terminate immediately.
[samples]
## Interaction
To ask a question print character "?" (without quotes), an integer _c_ (1 ≤ _c_ ≤ _n_), and _c_ distinct integers _p_1, _p_2, ..., _p__c_ (1 ≤ _p__i_ ≤ _n_) — the indexes of icicles that you want to know about. Note that "?" and _c_ should be separated by a space; the indexes should be separated by a space too.
After you asked the question, read a single integer — the answer.
Note that you can't ask more than **19** questions. If you ask more than 19 questions or at least one incorrect question, your solution will get "_Wrong answer_".
If at some moment your program reads - 1 as an answer, it should immediately exit (for example, by calling exit(0)). You will get "_Wrong answer_" in this case, it means that you asked more than 19 questions, or asked an invalid question. If you ignore this, you can get other verdicts since your program will continue to read from a closed stream.
Your solution will get "_Idleness Limit Exceeded_", if you don't print anything or forget to flush the output, including for the final answer .
To flush you can use (just after printing):
* _fflush(stdout)_ in C++;
* _System.out.flush()_ in Java;
* _stdout.flush()_ in Python;
* _flush(output)_ in Pascal;
* For other languages see the documentation.
**Hacking**
For hacking use the following format:
_n_ _x_ _y_ _p_1 _p_2
Here 1 ≤ _p_1 < _p_2 ≤ _n_ are the indexes of the special icicles.
Contestant programs will not be able to see this input.
## Note
The answer for the first question is .
The answer for the second and the third questions is 1, therefore, special icicles are indexes 1 and 3.
You can read more about bitwise _XOR_ operation here: [https://en.wikipedia.org/wiki/Bitwise_operation#XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR).
_Pay attention: this problem is interactive._
Penguin Xoriy came up with a new game recently. He has $n$ icicles numbered from $1$ to $n$. Each icicle has a temperature — an integer from $1$ to $10^9$. *Exactly two* of these icicles are special: their temperature is $y$, while a temperature of all the others is $x ≠ y$. You have to find those special icicles. You can choose a _non-empty_ subset of icicles and ask the penguin what is the bitwise exclusive OR (_XOR_) of the temperatures of the icicles in this subset. Note that you can't ask more than *19* questions.
You are to find the special icicles.
The first line contains three integers $n$, $x$, $y$ ($2 ≤ n ≤ 1000$, $1 ≤ x, y ≤ 10^9$, $x ≠ y$) — the number of icicles, the temperature of non-special icicles and the temperature of the special icicles.
To give your answer to the penguin you have to print character "!" (without quotes), then print two integers $p_1$, $p_2$ ($p_1 < p_2$) — the indexes of the special icicles *in ascending order*. Note that "!" and $p_1$ should be separated by a space; the indexes should be separated by a space too. After you gave the answer your program should terminate immediately.
To ask a question print character "?" (without quotes), an integer $c$ ($1 ≤ c ≤ n$), and $c$ distinct integers $p_1$, $p_2$, ..., $p_c$ ($1 ≤ p_i ≤ n$) — the indexes of icicles that you want to know about. Note that "?" and $c$ should be separated by a space; the indexes should be separated by a space too.
After you asked the question, read a single integer — the answer.
Note that you can't ask more than *19* questions. If you ask more than 19 questions or at least one incorrect question, your solution will get "_Wrong answer_".
If at some moment your program reads $ - 1$ as an answer, it should immediately exit (for example, by calling exit(0)). You will get "_Wrong answer_" in this case, it means that you asked more than 19 questions, or asked an invalid question. If you ignore this, you can get other verdicts since your program will continue to read from a closed stream.
Your solution will get "_Idleness Limit Exceeded_", if you don't print anything or forget to flush the output, including for the final answer .
To flush you can use (just after printing):
*Hacking*
For hacking use the following format:
$n$ $x$ $y$ $p_1$ $p_2$
Here $1 ≤ p_1 < p_2 ≤ n$ are the indexes of the special icicles.
Contestant programs will not be able to see this input.
The answer for the first question is .
The answer for the second and the third questions is 1, therefore, special icicles are indexes 1 and 3.
You can read more about bitwise _XOR_ operation here: https://en.wikipedia.org/wiki/Bitwise_operation#XOR.
## Input
The first line contains three integers $n$, $x$, $y$ ($2 ≤ n ≤ 1000$, $1 ≤ x, y ≤ 10^9$, $x ≠ y$) — the number of icicles, the temperature of non-special icicles and the temperature of the special icicles.
## Output
To give your answer to the penguin you have to print character "!" (without quotes), then print two integers $p_1$, $p_2$ ($p_1 < p_2$) — the indexes of the special icicles *in ascending order*. Note that "!" and $p_1$ should be separated by a space; the indexes should be separated by a space too. After you gave the answer your program should terminate immediately.
[samples]
## Interaction
To ask a question print character "?" (without quotes), an integer $c$ ($1 ≤ c ≤ n$), and $c$ distinct integers $p_1$, $p_2$, ..., $p_c$ ($1 ≤ p_i ≤ n$) — the indexes of icicles that you want to know about. Note that "?" and $c$ should be separated by a space; the indexes should be separated by a space too. After you asked the question, read a single integer — the answer. Note that you can't ask more than *19* questions. If you ask more than 19 questions or at least one incorrect question, your solution will get "_Wrong answer_". If at some moment your program reads $ - 1$ as an answer, it should immediately exit (for example, by calling exit(0)). You will get "_Wrong answer_" in this case, it means that you asked more than 19 questions, or asked an invalid question. If you ignore this, you can get other verdicts since your program will continue to read from a closed stream. Your solution will get "_Idleness Limit Exceeded_", if you don't print anything or forget to flush the output, including for the final answer . To flush you can use (just after printing):
*fflush(stdout)* in C++;
*System.out.flush()* in Java;
*stdout.flush()* in Python;
*flush(output)* in Pascal;
For other languages see the documentation.
*Hacking*
For hacking use the following format:
$n$ $x$ $y$ $p_1$ $p_2$
Here $1 ≤ p_1 < p_2 ≤ n$ are the indexes of the special icicles.
Contestant programs will not be able to see this input.
## Note
The answer for the first question is .
The answer for the second and the third questions is 1, therefore, special icicles are indexes 1 and 3.
You can read more about bitwise _XOR_ operation here: https://en.wikipedia.org/wiki/Bitwise_operation#XOR.
**Definitions**
Let $ n \in \mathbb{Z} $, $ x, y \in \mathbb{Z} $ with $ x \ne y $, $ 2 \le n \le 1000 $, $ 1 \le x, y \le 10^9 $.
Let $ A = (a_1, a_2, \dots, a_n) $ be a sequence of temperatures, where exactly two indices $ p_1, p_2 \in \{1, \dots, n\} $, $ p_1 < p_2 $, satisfy $ a_{p_1} = a_{p_2} = y $, and for all other $ i \notin \{p_1, p_2\} $, $ a_i = x $.
**Constraints**
1. You may query the XOR of any non-empty subset of indices at most 19 times.
2. Each query: output `? c i_1 i_2 ... i_c` where $ 1 \le c \le n $, and $ i_j \in \{1, \dots, n\} $ are distinct.
3. After each query, read the integer result: $ \bigoplus_{j=1}^c a_{i_j} $ (bitwise XOR).
4. Upon identifying $ p_1, p_2 $, output `! p1 p2` and terminate.
5. If any query is invalid or exceeds 19 queries, or if response is $-1$, terminate immediately.
**Objective**
Identify the two indices $ p_1, p_2 $ such that $ a_{p_1} = a_{p_2} = y $, using at most 19 XOR queries.
API Response (JSON)
{
"problem": {
"name": "E. The penguin's game",
"description": {
"content": "_Pay attention: this problem is interactive._ Penguin Xoriy came up with a new game recently. He has _n_ icicles numbered from 1 to _n_. Each icicle has a temperature — an integer from 1 to 109. **Ex",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 1000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF835E"
},
"statements": [
{
"statement_type": "Markdown",
"content": "_Pay attention: this problem is interactive._\n\nPenguin Xoriy came up with a new game recently. He has _n_ icicles numbered from 1 to _n_. Each icicle has a temperature — an integer from 1 to 109. **Ex...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "_Pay attention: this problem is interactive._\n\nPenguin Xoriy came up with a new game recently. He has $n$ icicles numbered from $1$ to $n$. Each icicle has a temperature — an integer from $1$ to $10^9...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ n \\in \\mathbb{Z} $, $ x, y \\in \\mathbb{Z} $ with $ x \\ne y $, $ 2 \\le n \\le 1000 $, $ 1 \\le x, y \\le 10^9 $. \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of temperatures,...",
"is_translate": false,
"language": "Formal"
}
]
}