#P8705. Combined Multi-Problem Challenge

    ID: 21869 Type: Default 1000ms 256MiB

Combined Multi-Problem Challenge

Combined Multi-Problem Challenge

This problem consists of five independent sub-problems. You are given a letter indicating which sub-problem to answer. Each sub-problem is a result‐filling question. Your program should read a single uppercase letter from the set {A, B, C, D, E} and output the corresponding computed integer answer (with no extra characters, spaces, or units). The five sub-problems are described below.

Problem A: Running Training

Initially, Xiao Ming has an energy level of \(10000\). If he runs, his energy decreases uniformly at a rate of \(600\) per minute. If he rests, his energy increases uniformly at a rate of \(300\) per minute. He alternates between running for one minute and resting for one minute. However, if at any moment his energy reaches \(0\) during a running period, he stops exercising immediately. Compute the total duration of his exercise in seconds. (Note: The answer is an integer; output the number only.)

Problem B: Anniversary

July 1, 2020 is the 99th anniversary of the establishment of an organization. The organization was founded on July 23, 1921. Calculate the total number of minutes between July 23, 1921 at 12:00 noon and July 1, 2020 at 12:00 noon. (Output the integer remainder.)

Problem C: Pooled Testing

To perform COVID-19 testing more efficiently with limited test kits, scientists propose a pooled testing procedure. In this procedure, samples from \(k\) persons are combined and tested in one kit. If the pooled test is negative, all \(k\) persons are deemed negative. If it is positive, all \(k\) persons are then individually tested (using a total of \(k+1\) kits including the initial pooled test). Given that the probability each person is infected is uniformly \(1\%\), determine the value of \(k\) (a positive integer) that minimizes the expected number of kits used per \(k\) persons. (Output the integer \(k\).)

Problem D: REPEAT Program

The input file contains a program written in a pseudo-language that supports the REPEAT k: construct. The control structure is based on indentation. For example, consider the following code snippet:

REPEAT 2:
    A=A+4
    REPEAT 5:
        REPEAT 6:
            A=A+5
        A=A+7
    A=A+8
A=A+9

Here, the statement A=A+5 inside the innermost loop is executed \(2 \times 5 \times 6 = 60\) times. Assuming the variable \(A\) is initially 0, compute the final value of \(A\) after the entire program executes. (Output the integer result.)

Problem E: Matrix Arrangement

Arrange the numbers \(1, 2, \dots, 2020\) in a \(2 \times 1010\) matrix such that in each row the numbers increase from left to right and in each column the bottom number is greater than the top number. Determine how many arrangements satisfy these conditions, and output the remainder when this number is divided by \(2020\). (Output the integer remainder.)

Note: The answers to the sub-problems are as follows:

  • Problem A: 3880
  • Problem B: 52037280
  • Problem C: 11
  • Problem D: 403
  • Problem E: 1340
  • Your program should select the correct answer based on the input letter.

    inputFormat

    The input consists of a single line containing one uppercase letter from the set {A, B, C, D, E}.

    outputFormat

    Output a single integer corresponding to the answer of the chosen sub-problem. Do not output any extra spaces or characters.

    sample

    A
    3880