#P10400. Multi-Task Submission Problem
Multi-Task Submission Problem
Multi-Task Submission Problem
This is a submission problem where an unknown positive integer (n) is provided as input. Initially, you have 1000 variables (p_1, p_2, \dots, p_{1000}) with (p_1 = n) and (p_2 = p_3 = \dots = p_{1000} = 0). Although the background story involves a set of allowed commands (such as new
, dec
, assign
, iftry
, ifeq
, and ifneq
with specific restrictions), your task is simplified to computing a function of (n) based on one of 10 subtasks.
The input consists of two integers. The first integer (T) (with (1 \le T \le 10)) specifies which subtask to execute, and the second integer is the initial value (n). The output should be an integer computed as follows:
- Task 1: Output (2n).
- Task 2: Output (\displaystyle \binom{n}{2} = \frac{n(n-1)}{2}).
- Task 3: Output (600).
- Task 4: Output (n+1).
- Task 5: Output (n^2 - 1).
- Task 6: Output (n + 2000).
- Task 7: Output (n + \lfloor \log_2 n \rfloor).
- Task 8: Output (n + (n \bmod 2) + 1).
- Task 9: Output (n + \gcd(n, n-4) + 1).
- Task 10: Output any positive integer (x) satisfying (|x - n\ln n| \le 30).
Note: The tasks are arranged by output length and are independent of difficulty.
inputFormat
The first line contains an integer (T) (1 ≤ T ≤ 10) indicating the task number. The second line contains a positive integer (n).
outputFormat
Output the computed result corresponding to the given task.
sample
1
5
10