P17237 『STA - R10』Dielectric Constant

Description

You have 52 memory cells and 4 types of computation nodes. Initially, memory cell 1 and 2 store real numbers $a$ and $b$ respectively ($0.09 \le a,b \le 0.1$). The values in other cells are unspecified, and you are not allowed to reference them before assigning values to them. You may use the following four types of computation nodes (the result of the $i$-th computation is stored in memory cell $i+2$): 1. Constant node `0 c`: returns the constant $c$ (up to 15 significant digits). 2. Addition node `1 x y`: returns the sum of the numbers in memory cell $x$ and memory cell $y$. 3. Multiplication node `2 x y`: returns the product of the numbers in memory cell $x$ and memory cell $y$. 4. Function node `3 x s`: returns the result of applying function `s` to the value in memory cell $x$. Here `s` is one of the following strings: `sin cos tan sec csc cot asin acos atan asec acsc acot` (you may search for and understand their definitions on your own). You need to complete the following two computation tasks: - A+B task: **use only computation nodes 1, 3, and 4** to compute $a+b$, and store it in the memory cell with the largest index among those you assigned. - A*B task: **use only computation nodes 1, 2, and 4** to compute $a \times b$, and store it in the memory cell with the largest index among those you assigned. If the checker determines that the absolute error between your computed result and the correct answer is at most $10^{-9}$, your output is considered correct. The checker used for judging can be downloaded from the provided files. Due to floating-point errors, the final judging result is based on the checker.

Input Format

This is an output-only problem, so you can submit a compressed package of your answer directly. However, you may also choose to read the task number $t$ from input. Here, $t=1$ means you need to solve the A+B task, and $t=2$ means you need to solve the A*B task.

Output Format

The first line contains a positive integer $n$, indicating the number of computation nodes you call ($n \le 50$). The next $n$ lines each describe one computation node.

Explanation/Hint

The sample is for reference only and cannot get any points. If you complete one task perfectly correctly, you get 50 points; otherwise, you get 0 points. Translated by ChatGPT 5