| SMU ICPC Selection Contest 2026 |
|---|
| Закончено |
Apollo, the god of prophecy, has hidden an integer $$$n$$$ ($$$1\leq n\leq 10^8$$$). Mortals are not allowed to know $$$n$$$ directly, but Apollo may answer queries and perform divisions for you.
One of Apollo's prophecies states that an integer $$$x$$$ is sacred if and only if $$$x$$$ has at most $$$8$$$ positive divisors.
Although mortals do not know Apollo's value of $$$n$$$, Apollo believes you are no mere mortal. Prove your worthiness by reducing $$$n$$$ to a sacred value $$$n'$$$ (where $$$n' \leq n$$$).
For the purposes of this interaction, the jury acts on Apollo's behalf.
The interaction begins when you ask your first query. On your turn, you can make one of three types of queries:
In the event that you read -1 instead of valid data, your program must terminate immediately. This indicates that your submission has made an invalid query or has otherwise received a Wrong Answer verdict.
0 # reply 1 1 # reply 2 1 # reply 3 16 # reply 4
div 3 # query 1 div 4 # query 2 div 4 # query 3 gcd 16 # query 4 ! # answer
The following sample interaction is meant to showcase the interaction between your program and the jury, but does not show how the answer was derived. Note that comments (marked by #) are there for readability and are not part of the actual interaction.
Apollo's integer was initially $$$n = 256$$$. The sample makes a total of $$$4$$$ out of $$$7$$$ queries.
| Название |
|---|


