AGM 2024, Final Round, Day 2
A. Bushes
time limit per test
0.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

B. Differential Equation
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
1
1 1 4 1 1
Output
-499.700100

C. Minimum Effort
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
5
6 1 1 1 7
Output
29

D. MasterChef
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
3
1 2 3
1 3 4
1 4 5
Output
YES
0 1 1
1 0 0
0 1 1

E. Maze Ball
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 3 2 2 1 2 3
0 0 0
0 1 0
0 0 0
Output
3
Input
7 7 3 1 1 2 5
0 0 0 1 0 0 0
0 0 0 1 0 0 0
1 1 0 1 0 1 0
0 0 0 1 0 0 0
0 0 0 0 0 1 0
0 0 1 0 0 0 0
0 0 0 0 0 0 0
Output
4
Input
5 5 3 1 1 1 5
0 0 1 0 0
0 0 1 1 0
0 0 0 1 0
0 0 1 0 0
0 0 0 0 0
Output
3
Input
3 3 2 1 1 2 2
0 0 0
0 0 0
0 0 0
Output
-1

F. Mountain Heights
time limit per test
2.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 3
3 7 2
Output
1
1 
Input
8 4
7 5 1 4
Output
2
1 3 

G. Pants
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
4
1 2
1 3
2 4
Output
8

H. Payday Quest
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
4 3 3
1 1 1 1
1 2
1 1
2 2
5 1
3 1
6 3
1 3
2 8
3 1
2
5
1
8 1
4 1
1
9 2
1 1
2 4
Output
333333341
333333338
8
500000012

I. Pollen
time limit per test
2.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3 3 2
1 2 5
7 3
6 2
3 1
Output
4

J. Shepherd
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
5
9.0 2.0
0.0 1.2648
0.1435 0.6318
4.6564 0.5061
5.3393 0.0
5
1 4.21 1.5648
1 4 1
2 1 2
1 5 1
2 1 2
Output
0.60258
0.60258

K. Sorting Network
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
4
Output
6
1
11
3
6
1
11

L. Spin To Win
time limit per test
0.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
3
0 0
0 1
0 10
Output
4.500000
Input
5
0 0
-3 0
-2 2
-1 3
0 4
Output
1.414214
Input
5
-3 -8
-8 -4
-4 -4
8 3
6 0
Output
5.385165