2023 ICPC World Finals
A. Riddle of the Sphinx
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

B. Schedule
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
2 6
Output
4
11
12
21
22
11
12
Input
2 1
Output
infinity

C. Three Kinds of Dice
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
6 1 1 6 6 8 8
3 2 4 9
Output
0.291666667 0.750000000
Input
4 9 3 7 5
3 4 2 3
Output
0.500000000 0.500000000

D. Carl's Vacation
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
0 0 10 0 4
9 18 34 26 42
Output
60.866649532

E. A Recurring Problem
time limit per test
20 s
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3
Output
2
1 1
1 1
2 3 5 8 13 21 34 55 89 144
Input
1235
Output
4
1 1 3 1
3 2 1 1
9 15 44 99 255 611 1519 3706 9129 22377

F. Tilting Tiles
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 4
.r..
rgyb
.b..
.yr.

yrbr
..yr
...g
...b
Output
yes
Input
1 7
....x..

..x....
Output
no
Input
4 3
yr.
..b
ry.
b..

...
..b
.ry
byb
Output
no

G. Turning Red
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
8 6
GBRBRRRG
2 1 4
1 2
4 4 5 6 7
3 5 6 7
1 8
1 8
Output
8
Input
4 3
RGBR
2 1 2
2 2 3
2 3 4
Output
impossible
Input
4 4
GBRG
2 1 2
2 2 3
2 3 4
1 4
Output
6
Input
3 3
RGB
1 1
1 2
1 3
Output
3

H. Jet Lag
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3
30 45
60 90
120 180
Output
2
0 30
90 120
Input
1
0 60
Output
impossible
Input
7
31 32
35 41
48 55
69 91
1000 2022
2022 2023
2994 4096
Output
5
0 5
10 28
56 68
92 900
2025 2900

I. Waterworld
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 7
63 61 55 54 77 87 89
73 60 38 5 16 56 91
75 43 11 3 16 20 95
Output
51.8095238095
Input
4 3
10 10 10
10 10 10
10 10 10
10 10 10
Output
10.0000000000

J. Bridging the Gap
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 2
1 2 10 5
Output
17
Input
4 6
1 2 10 5
Output
10

K. Alea Iacta Est
time limit per test
10 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5 8
ABCDEP
AEHOXU
AISOLR
ABCDEF
ABCSCC
PARSE
PAUSE
PHASE
POISE
PROSE
PULSE
PURSE
PEACE
Output
9.677887141
Input
2 1
AAAAAA
BBBBBB
AB
Output
1.000000000
Input
3 1
123456
123456
123456
666
Output
10.555444555
Input
2 1
ABCDEF
GHI234
AB
Output
impossible