European Championship 2024 - Online Mirror (Unrated, ICPC Rules, Teams Preferred)


A. Grove
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 1.241
Output
2
4 2
2 4
Input
9 2.0
Output
4
2 2
7 2
2 6
6 6
----------------------------------------------------------------------------------------------------
B. Charming Meals
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
0 0 0
1000000000 1000000000 1000000000
5
1 2 3 4 5
1 2 3 4 5
6
0 0 0 100 100 100
100 100 100 0 0 0
7
14 25 62 74 86 95 12
51 62 71 72 92 20 84
Output
1000000000
2
100
30
----------------------------------------------------------------------------------------------------
C. Annual Ants' Gathering
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
5 1
3 2
4 6
3 6
7 1
1 3
Output
YES
Input
5
1 4
4 2
3 2
5 3
Output
NO
Input
6
4 5
5 6
6 1
2 6
3 2
Output
YES
----------------------------------------------------------------------------------------------------
D. Funny or Scary?
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
.?F??
?.???
F?.S?
??S.?
????.
Output
.FFFF
F.FFF
FF.SF
FFS.F
FFFF.
Input
12
.???????????
?.??????????
??.?????????
???.????????
????.???????
?????.??????
??????.?????
???????.????
????????.???
?????????.??
??????????.?
???????????.
Output
.SSSFFSSSSFS
S.SFFSFSFFFS
SS.SFFFSSSFS
SFS.FFSSSSFS
FFFF.FFFFFSF
FSFFF.SFFSFF
SFFSFS.SSSFS
SSSSFFS.SSFS
SFSSFFSS.SFS
SFSSFSSSS.FS
FFFFSFFFFF.F
SSSSFFSSSSF.
----------------------------------------------------------------------------------------------------
E. Damage per Second
time limit per test: 5 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
1 7
14
Output
3 4
Input
4 9
1 2 3 4
Output
4 5
Input
5 13
3 4 5 6 7
Output
7 6
----------------------------------------------------------------------------------------------------
F. Dating
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 5
3 1 2 4
5 1 2 3 4 5
2 1 5
Output
YES
3 1
Input
3 3
1 1
1 2
3 2 3 1
Output
NO
----------------------------------------------------------------------------------------------------
G. Scooter
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
CM-
-CM
Output
7
DRIVE 3
PICKUP
DRIVE 2
DROPOFF
PICKUP
DRIVE 1
DROPOFF
Input
1
C
C
Output
0
Input
2
-M
MC
Output
4
DRIVE 1
PICKUP
DRIVE 2
DROPOFF
----------------------------------------------------------------------------------------------------
H. Division Avoidance
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
0 0
1 0
0 1
1 1
16
0 0
0 1
0 2
0 3
1 0
1 1
1 2
1 3
2 0
2 1
2 2
2 3
3 0
3 1
3 2
3 3
Output
YES
NO
----------------------------------------------------------------------------------------------------
I. Disks
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
0 2 1
0 0 1
4 -3 4
11 0 3
11 5 2
Output
YES
Input
4
2 2 2
7 2 3
7 7 2
2 7 3
Output
NO
----------------------------------------------------------------------------------------------------
J. Amanda the Amoeba
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 8
.******.
**.X**..
*******.
**.X**..
.******.
.******.
...X****
.*******
...X****
.******.
Output
YES
5
3 1 3 8
2 1 2 8
4 1 4 8
2 2 4 7
4 2 2 7
Input
2 5
*.X..
**X..
..X**
..X*.
Output
NO
----------------------------------------------------------------------------------------------------
K. Make Triangle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
6 2 2 2
1 1 1 1 1 1
5 3 1 1
1 1 1 1 1
6 2 2 2
1 1 1 1 1 3
8 1 2 5
16 1 1 1 1 1 1 12
Output
YES
1 1 
1 1 
1 1 
NO
NO
YES
16 
12 1 
1 1 1 1 1 
----------------------------------------------------------------------------------------------------
