#P8740. Multi‐Part Result Fill‐in Challenges

    ID: 21904 Type: Default 1000ms 256MiB

Multi‐Part Result Fill‐in Challenges

Multi‐Part Result Fill‐in Challenges

This problem consists of 5 independent result fill‐in tasks. In each sub‐problem you are given a description and you must compute a single integer result. Your program should output the results of the 5 tasks in order (one per line) as follows:

Problem A: Card Construction

Little Blue has digit cards for 0 through 9. He has exactly 2021 copies of each, for a total of 20210 cards. He wants to form all positive integers consecutively starting from 1, using exactly the digits required for each number (and each card can be used only once). For example, if there were 3 copies of each digit (total 30 cards), he can form 1 through 10 but cannot form 11 because the digit 1 would be used too many times. Determine the largest integer k such that he can form all numbers from 1 to k. (In our instance the computed answer is given below.)

Problem B: Distinct Lines in a Grid

Consider all integer points in the plane of the form { (x,y) | 0 ≤ x < 20, 0 ≤ y < 21 }. These 420 points determine many lines. It is known that for the 2×3 grid (points with 0 ≤ x < 2, 0 ≤ y < 3) the number of distinct lines is 11. Compute the number of different lines determined by the 20×21 grid. (The answer has been pre‐computed.)

Problem C: Cargo Stacking

Little Blue has n identical cube boxes to be arranged in a rectangular cuboid shape with dimensions L × W × H such that L×W×H = n. Different orderings are considered distinct. For example, n = 4 has 6 solutions. For n = 2021041820210418 (a 16‐digit number) compute the number of stacking arrangements. (Answer pre‐computed.)

Problem D: Special Shortest Path

A graph is given with 2021 nodes labeled 1 to 2021. For any two distinct nodes a and b, an edge exists if and only if |a−b| ≤ 21; the edge length is the least common multiple of a and b (which can be written in \(\LaTeX\) as \(\mathrm{lcm}(a,b)\)). Compute the shortest path length from node 1 to node 2021. (Answer pre‐computed.)

Problem E: Hamiltonian Cycle Count

There are 21 buildings labeled 1 to 21. Two buildings a and b are directly connected by a corridor if and only if a and b are coprime. Little Blue wants to start from building 1, visit every building exactly once and return to 1 (a Hamiltonian cycle). Count the number of distinct visitation schemes. Two schemes are different if the successor of some building differs. (Answer pre‐computed.)

Input: There is no input.

Output: Your program should output 5 lines. The i-th line contains the answer for Problem (A + i - 1). The expected answers are:

3181
53181
810
10374
6912

Note: Although each sub‐problem is a result fill‐in question, you must output all 5 results, each on a separate line, in the order specified above.

inputFormat

There is no input for this problem.

outputFormat

Output exactly 5 lines. The first line is the answer for Problem A, the second for Problem B, the third for Problem C, the fourth for Problem D, and the fifth for Problem E.

3181
53181
810
10374
6912

sample

3181

53181 810 10374 6912

</p>