P11211 『STA - R8』Random Number Generator.
Background
**Upd on 2024/10/22** Added one set of hack testdata (#13).
Description
**This is an interactive problem.**
Lloyd has a random number generator. For a random seed $s$ and generator type $t$, the random number it generates at the $x$-th time ($x
Input Format
See the implementation details part in the description.
Output Format
See the implementation details part in the description.
Explanation/Hint
**Sample explanation**
The samples are for reference only and may not have actual logic.
Sample 1: $p=10007$, $s=114$, and it had generated random numbers $513$ times before the queries.
Sample 2: $p=10007$, $s=514$, and it had generated random numbers $113$ times before the queries.
***
**Constraints**
**This problem uses bundled tests.** (The Subtask score is the minimum score among all test points within the Subtask.)
- Subtask 1 (20pts): $t=1$.
- Subtask 2 (20pts): $p\le 10^3$.
- Subtask 3 (60pts): No special constraints.
For all testdata, $2\le p\le2\times10^6$ and $p$ is prime, $t\in\{1,2\}$. A solution is guaranteed to exist.
For each test point, if you send `?` to the interactive library $c$ times, then the score you can get is given by:
$$\mathrm{score}=\begin{cases}100&c\le 5\\\max\{0,100-\lceil10\ln(c)\rceil\}&\text{otherwise.}\end{cases}$$
Translated by ChatGPT 5