The 2023 ICPC Asia Taoyuan Regional Programming Contest
A. Counterfeit Money
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
123456789
593825856
Output
456 NO
624 YES

B. Recurring Decimal to Fractions
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
1 3
0
012
3 1
085
3
Output
2 1665
32 375

C. Where the Lantern Lights are Dimming
time limit per test
3 с
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 3
0 0
0 0
0 0
W 0 2
W 1 1
C 3
Output
6
Input
5 5
1 5
0 0
-1 2
1 0
0 -2
C 1
W 0 4
C -2
W 1 3
C 3
Output
9

D. Quarantine Policy
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
4 4 7 3
.V..
....
..V.
....
2 2 1 1
V.
..
Output
Airplane #1:
7V70
3773
07V7
0373

Airplane #2:
V1
11

E. Slabstones Rearrangement
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
4 2
2 6 4 12
8 4 16 8
7 10 11 16
18 4 20 18
6 4
2 5 4 11
2 14 6 17
7 10 10 16
9 4 16 7
11 11 16 14
18 4 20 18
Output
28
0

F. Baker's Dilemma
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
4
3 4
1 1000
2 2
5 5
5
3 4
1 1000
8 8
2 2
5 6
Output
2 1 3 4

2 1 5 3 4

G. A Packing Problem
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 3
4 2 1 2
4 2 2 3
4 2 3 1
4
Output
Assignment
1 2 3 
Input
4 3
4 2 1 2
4 2 2 3
4 2 3 1
4 3 1 2 3
4
Output
Proof
1 1 1 1
1 1 1

H. Bank Deposit Challenge
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
100
10 5 15 7
20 30 50 70
Output
30
Input
500
72 2 2 10 12 10 10 17 13 15
120 10 5 20 25 100 80 300 50 100
Output
144
Input
5
1 2
10 20
Output
0

I. The Pentagon Conjecture
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Due to large input file size, each input file has been partitioned into $$$t$$$ smaller files, each with $$$1$$$ test case ($$$t = 1$$$). Below are the differences between the original problem and the problem on Codeforces:

  • $$$1 \le t \le 10 \to t = 1$$$.
  • Time limit: $$$10$$$ seconds $$$\to$$$ $$$1.5$$$ seconds.
Example
Input
1
7 28
1 2 3
1 2 4
1 2 5
1 2 6
1 2 7
1 3 4
1 3 5
1 3 6
1 3 7
1 4 5
1 4 6
1 4 7
1 5 6
1 5 7
1 6 7
2 3 4
2 3 5
2 3 6
2 3 7
2 4 5
2 4 6
2 4 7
2 5 6
2 5 7
2 6 7
3 4 5
3 4 6
3 4 7
Output
1 2 3 4 7

J. Lead Time Estimation
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
8 11
2,7,2,6,5,1,2,7
6 7 2
0 1 4
0 2 2
1 3 6
1 4 5
1 5 3
2 4 1
3 6 2
3 7 9
4 5 2
5 7 2
Output
41,0,1,3,7
Input
6 7
10,8,9,10,11,12
0 1 1
1 2 2
1 3 3
1 4 4
2 5 5
3 5 6
4 5 7
6 7
10,8,9,11,11,12
0 1 1
1 2 2
1 3 4
1 4 4
2 5 5
3 5 7
4 5 7
Output
53,0,1,4,5
53,M

K. Chemical Storage
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
6
4 2
1 2 2
1 4
3 4
4 2
1 2 2
1 4
1 4
5 2
1 2 2 4
1 4
3 4
11 4
1 2 3 4 5 2 4 3 5 8
1 6 7 8
1 3 5 8
11 4
1 2 3 4 5 2 4 3 5 8
1 3 5 8
7 8 9 10
10 5
1 2 3 4 2 3 3 6 4
2 4 7 8 9
1 5 6 7 8
Output
0
1
1
0
1
1

L. Nine Never
time limit per test
4.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
11
Output
4

M. Task scheduler
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
4
1
0
5
3
0 1 2
1 0 0
4
0 1 2 3
6 4 2 2
8
0 1 2 3 4 5 6 7
10 12 12 3 1 3 1 1
Output
0
1 2 0
2 3 1 0
4 6 7 3 5 0 1 2