P2838 The Story of Bottle Country

Background

This is a non-traditional problem. Legend has it there is a country called Bottle Country, filled with bottles of various sizes. Now Bottle Country wants to learn from its neighbor, Flea Country, to develop computers, but Bottle Country has no computers—only bottles. So the king of Bottle Country gives you some bottles to carry out certain computational tasks.

Description

We use the amount of water to represent a number. - The capacity of a bottle is the maximum amount of water it can hold. The king of Bottle Country believes bottles can do the following: - $\verb!I!$: Create a new bottle whose capacity and current amount of water are both equal to the input number. Its index is $\textbf{当前最大编号} +1$. - $\verb!F !s$: Fill the bottle with index $s$ to its full capacity. - $\verb!E !s$: Empty the bottle with index $s$. - $\verb!C !s$: Create a new bottle with capacity $s$ and no water in it. Its index is $\textbf{当前最大编号} +1$. Note that due to limited capacity, $0\le s\le 10^9$. - $\verb!M !s$: Create a new bottle whose capacity equals $\textbf{s 号瓶子里装的水的数量}$ and which initially contains no water. Its index is $\textbf{当前最大编号}+1$. - $\verb!T !a\ b$: Pour water from bottle $a$ into bottle $b$ until bottle $a$ becomes empty or bottle $b$ becomes full (note $a\neq b$). - $\verb!O !s$: Output the amount of water in bottle $s$. There is also an expensive operation: - $\verb!K !a\ b$: Create a new bottle whose capacity equals $\textbf{a 号瓶子的容量} \times \textbf{b 号瓶子的容量}$. Its index is $\textbf{当前最大编号}+1$. Note that due to capacity limits, $\textbf{a 号瓶子的容量}\times\textbf{b 号瓶子的容量}$ must not exceed $10^9$. (Using this operation deducts points; see the scoring rules below.) The king gives you these operations; you only need to output them, and the bottles will execute them for you! The king of Bottle Country gives you several computational tasks. Just implement these tasks. On the left are the data point IDs; on the right are the tasks: 1. Given $a$ and $b$, compute $a+b$. ($0\le a,b\le 10^5$) 2. Given $a$ and $b$, compute $|a-b|$. ($0\le a,b\le 10^5$) 3. Given $a$ and $b$, compute $\max(a,b)$. ($0\le a,b\le 10^5$) 4. Given $a$ and $b$, output $\gcd(a,b)$. ($1\le a,b\le 1000$) 5. Given $a$, output the 32-bit binary representation of $a$. ($0\le a\le 10^5$, for example, $5$ outputs $\verb!0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1!$) 6. Given $a$ and $b$, output $a\times b$. ($0\le a,b\le 1000$) 7. Given $a$ and $b$, output $a\oplus b$. ($0\le a,b\le 10^5$, where $\oplus$ denotes bitwise XOR) 8. Given $a$, output $\lfloor a\div 10 \rfloor$. ($1\le a\le 10000$) 9. Given $a$ and $b$, output $a\times b \bmod 262144$. ($0\le a,b\le 10^5$) 10. Given $a$ and $b$, output $a^b$. ($1\le a,b\le 1000$, and $a^b$ does not exceed $10^6$) The king will generate about $30$ groups of testdata to test your program and will score it based on the number of operations you use. See the scoring rules below. (UPD: If you did not understand the problem, here is an additional explanation.) Your program submitted to Luogu (C/C++/Pascal) must output a sequence of operations in the format similar to the sample output. For example, for the first data point, after submission the checker on Luogu will randomly generate $a$ and $b$ as the inputs to the $\verb!I!$ operation to test your operations. For the local checker (see the Hint section for download), you can save your output operations to a file named `a.txt`. Then input `a.txt` on the first line. On the second line, input $0$ if playing manually, or input the specific data point ID if testing that point.

Input Format

A single line containing one integer representing the data point ID.

Output Format

Output a sequence of operations that satisfies the computational task.

Explanation/Hint

Please note you are submitting a program that outputs operations! (If you generate the answers and then delete the program and directly hardcode the outputs, your output might exceed limits.) Inspired by NOI2016 “Wilderness Big Computation” (you probably knew that anyway). For convenient local testing, here is a C++ local checker (note that its results may differ from Luogu’s; Luogu may be stricter): - http://paste.ubuntu.com/23070332/ If you need an executable, you can use Baidu Netdisk: - http://pan.baidu.com/s/1o7HZ1GY Password: `kqhl`. Scoring Rules: If your algorithm produces a wrong result (extra outputs also count), or a runtime error occurs (operations violate the rules, etc.), or the number of lines exceeds $5\times 10^6$, or the lines are so many that the checker cannot finish testing $30$ groups within $1$ s, you receive $0$ points. Otherwise, suppose the standard solution uses $s$ steps and your solution uses $x$ steps. - If $x\le s$, your base score is $10$ points. - If $s