East China University of Science and Technology Programming Contest 2025
A. Golden Alleyway
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Examples
Input
3 2 1 2
Output
7000
Input
1 0 0 4
Output
6000
Note

Please refer to the statements in the attachment files

B. Seeing is believing
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Examples
Input
0 1 2
Output
5
Input
63 1 1
Output
67
Note

Please refer to the statements in the attachment files

C. Time Trouble
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
5
9 41
9 61
50 9
0 6
25 35
Output
09:41
-1
09:50
00:06
-1
Note

Please refer to the statements in the attachment files

D. Mosaic Garden
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
NO_INPUT
Output
ECUST
ECUSt
ECUsT
<lines omitted>
ecust
Note

Please refer to the statements in the attachment files

E. Fortress Fall
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
6
4 1 2
4 5 6 7
5 2 8
0 -1 -2 -6 7
6 -1 -2
1 2 3 4 5 6
6 3 4
-1 0 0 1 2 3
6 -3 -4
1 0 0 -1 -2 -3
5 1 -10
-9 2 -5 3 -7
Output
35
56
0
23
23
165
Note

Please refer to the statements in the attachment files

F. The Tower(XVI)
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
4
1 100
2 4
74700 1
2279 1
Output
2
6
6
5
Note

Please refer to the statements in the attachment files

G. Midnight Monsoon
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
1
4 3
1 2 3 4
4 0
2 5
1 -2
Output
3
6
8
Note

Please refer to the statements in the attachment files

H. Square the Circle
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Interaction

Please refer to the statements in the attachment files

Example
Input
1
IN
IN
OUT
IN
Correct!
Output
? 1 0
? 0 1
? 100 100
? 0 2
! Bumper
Note

Please refer to the statements in the attachment files

I. Chromatic Complex
time limit per test
9 s
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
2
3 5 3 2
1 1
00000
11211
11011
1 4
3 1
3 5
1 5 1 1
1 1
01121
1 5
Output
2
-1
Note

Please refer to the statements in the attachment files

J. Attack from clone
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
4
3 2 3 2 2
4 3 2 5 1
4 1 1 5 2
9 7 8 3 0
Output
3
6
6
12
Note

Please refer to the statements in the attachment files

K. Clockwork
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
4
6
1 2 1 1 2 3
3
3 3 3
6
1 1 1 1 1 1
11
1 2 1 3 4 1 2 1 1 2 3
Output
3
-1
6
6
Note

Please refer to the statements in the attachment files

L. Forest Path
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
1
7
1 2
1 3
2 4
2 5
3 6
3 7
10 10 10 11 15 15 11
Output
7 4
Note

Please refer to the statements in the attachment files

M. FLOATING POINT
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
4
2
3
4
5
Output
9 15
4 5 6
9 10 12 15
8 9 10 11 12
Note

Please refer to the statements in the attachment files

N. In Filtration
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
4
1
4 6
5 7
2
1 1
8 2
8 9
2
4 1
2 3
7 8
4
7 10
2 11
5 3
9 20
14 6
Output
YES
NO
YES
NO
Note

Please refer to the statements in the attachment files

O. Nelumbo
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Please refer to the statements in the attachment files

Input

Please refer to the statements in the attachment files

Output

Please refer to the statements in the attachment files

Example
Input
1
6
1 2
1 3
2 4
2 5
3 6
6 2 3 4 2 1
Output
332748119
Note

Please refer to the statements in the attachment files