Problem K
Four Questions
It looks like taking the singles line has paid off: you’re stuck on the ski lift with a mathematician. He’s promised to show you his secret powder stash1 if you’re able to win a game against him. The game is as follows.
He will think of some prime number
Oh, and since the ski lift only takes a few minutes to get
to the top, there’s only enough time for four rounds. Can you
win the game by determining
Interaction
You may output up to four queries followed by a single answer. After each query the judge will respond with the result of your query. It is important that you flush your output stream after each query, so that the judge receives your output (otherwise, you may recieve a TLE verdict). For example, in Python this can be done with sys.stdout.flush() or in C++ with cout << flush.
A query is performed by printing a line of the form
q
Once you know the value of
Read | Sample Interaction 1 | Write |
---|
q 43
3
q 15
12
q 71
0
a 71
Footnotes
- A little-known area with lots of deep snow.