Computation - Task 2

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Given a task, you should write a program that solves the task using the instructions below. Let x_tx\_t denote the result of the tt-th instruction. The permitted instructions, the syntax, and the result x_tx\_t are given below:

NameOperatorParametersEffects
InputIN/ARead a real number from the terminal and make the number x_tx\_t
OutputOiiPrint x_ix\_i to the terminal, and x_t=x_ix\_t = x\_i
Addition+iji \quad jx_t=x_i+x_jx\_t = x\_i + x\_j
Adding constantCici \quad cx_t=x_i+cx\_t = x\_i +c
Negate-iix_t=x_ix\_t = -x\_i
Left shift<iki \quad kx_t=x_i2kx\_t = x\_i \cdot 2^k
Right shift>iki \quad kx_t=x_i2kx\_t = x\_i \cdot 2^{-k}
SSiix_t=s(x_i)x\_t = s(x\_i)
ComparisonPiji \quad jx\_t = \left\\{ \begin{array}{ll} -1 & \quad x\_i < x\_j \\\ 0 & \quad x\_i = x\_j \\\ 1 & \quad x\_i > x\_j \end{array} \right.
MaxMiji \quad jx\_t = \left\\{ \begin{array}{ll} x\_i & \quad x\_i > x\_j \\\ x\_j & \quad x\_i \leq x\_j \\\ \end{array} \right.
Multiplication*iji \quad jx_i=x_ix_jx\_i = x\_i \cdot x\_j

Here, the definition of s(x)s(x) is given below where e=2.718281828459045e = 2.718281828459045\ldots is the base of natural logarithm:

s(x)=11+ex.\displaystyle s(x) = \frac{1}{1 + e^{-x}}.

Notice there is a penalty for using the P, M, and * operators. See details below in the "grading" section.

For each instruction, the parameters ii and jj must be smaller than the current instruction number tt. The instructions are executed in the order, one by one.

The operations have finite precision: in particular, the results are only accurate up to 90 digits after the decimal point and the rest will be rounded. Similarly, the argument cc to the adding constant instruction can have at most 90 digits in its decimal part.

For left shift and right shift instructions, kk must be a non-negative integer not exceeding 10000.

The ten tasks are given below:

  • Task 1: Given a,ba,b where a,b109|a|, |b| \leq 10^9 and a,ba,b have at most 9 digits in their decimal parts, compute 2a2b-2a-2b.
  • Task 2: Given aa where a109|a| \leq 10^9 and aa has at most 9 digits in its decimal part, compute 11+e17a\frac{1}{1+e^{17a}}.
  • Task 3: Given aa where a109|a| \leq 10^9 and aa has at most 9 digits in its decimal part, compute \left\\{ \begin{array}{ll} -1 & \quad a < 0\\\ 0 & \quad a = 0\\\ 1 & \quad a > 0 \end{array} \right..
  • Task 4: Given aa where a109|a| \leq 10^9 and aa has at most 9 digits in its decimal part, compute the absolute value of aa, a|a|.
  • Task 5: Given a_1,,a_32a\_1,\ldots,a\_{32} where a_1,,a_320,1a\_1,\ldots,a\_{32} \in \\{0,1\\}, treat a_1a_2a_32a\_1a\_2 \cdots a\_{32} as a binary number where a_1a\_1 is the most significant bit and a_32a\_{32} is the least significant bit, compute the corresponding value (in base 10).
  • Task 6: Given integer aa where 0a<2320 \leq a < 2^{32}, output 32 integers denoting aa in base 2 representation. The most significant bit should be printed first and the least significant bit should be printed last. If aa has less than 32 bits in its binary representation, add leading 0s.
  • Task 7: Given integers a,ba,b where 0a,b<2320 \leq a,b < 2^{32}, compute the bitwise XOR of aa and bb.
  • Task 8: Given aa where a109|a| \leq 10^9 and aa has at most 9 digits in its decimal part, output a10\frac{a}{10}.
  • Task 9: Given a_1,,a_16a\_1,\ldots,a\_{16} where a_i109|a\_i| \leq 10^9 and a_ia\_i has at most 9 digits in its decimal part, print 16 real numbers representing the result of sorting a_1,,a_16a\_1,\ldots,a\_{16} in ascending order.
  • Task 10: Given integers a,b,ma,b,m where 0a,b<2320 \leq a,b < 2^{32}, 1m<2321 \leq m < 2^{32}, compute the remainder after dividing a×ba \times b by mm (i.e. compute a×bmodma \times b \bmod m).

출력

The ii-th line describes the ii-th instruction: first, you should output a letter denoting the operation. Then output several (or zero) integers denoting the parameters to the operation. The operator and the parameters (and between parameters) should be separated by a single space.

You can output at most 10410^4 lines.