#P8690. Multi-Subtask Contest Problem

    ID: 21856 Type: Default 1000ms 256MiB

Multi-Subtask Contest Problem

Multi-Subtask Contest Problem

Problem Statement

This contest problem consists of 5 independent subtasks. Each subtask is a result‐fill problem; you are required to output a single integer for each. The final output of your program should contain exactly 5 lines corresponding to subtasks A through E as described below.

Subtask A: Square Sequence

Find two positive integers \(X\) and \(Y\), satisfying:

  • \(2019 < X < Y\)
  • \(2019^2, X^2, Y^2\) form an arithmetic progression; i.e., \(2X^2 = 2019^2 + Y^2\).

Among all solutions, output the minimum possible value of \(X+Y\). (Answer is a single integer.)

Subtask B: Prime Partition

Express \(2019\) as a sum of two distinct prime numbers. Count the number of different ways to do this. (Order does not matter.) (Answer is a single integer.)

Subtask C: Concatenation (Paving)

A wooden square is subdivided into a grid of \(n \times n\) small squares. Each square is marked as belonging to the left or right part. The wood is cut along the border between the parts and the right piece is rotated 90° upward and reattached, forming a larger square. The conditions are that each small square must belong exclusively to the left or to the right and each side’s squares must be connected. Moreover, the reattached part must lie completely within the original large square. For \(n=7\), compute the number of legal markings. (Answer is a single integer.)

Subtask D: Evaluation

Define \(S_t\) to be the smallest positive integer that has exactly \(t\) divisors. For example, \(S_1=1, S_2=2, S_3=4, S_4=6, \dots\). Your task is to compute \(S_{100}\). (Answer is a single integer.)

Subtask E: Path Counting

Consider a \(5 \times 5\) grid. Starting from the upper‐left corner, count the number of simple (non self-intersecting) closed paths along grid edges that:

  • Have total length at most 12,
  • End at the starting point, and
  • Do not leave the grid boundary.
  • Different paths (even if they are mirror images or rotations) are counted separately. (Answer is a single integer.)

    Note: For each subtask, you only need to output the final computed integer. Do not output extra characters.

    inputFormat

    This problem does not require any input.

    outputFormat

    Output exactly 5 lines. Each line must contain the integer answer for the corresponding subtask in the order A, B, C, D, and E.

    sample

    6088
    

    1 510 45360 103

    </p>