2020-2021 ICPC Northwestern European Regional Programming Contest (NWERC 2020)
A. Atomic Energy
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 5
2 3 5 7
2
3
5
6
8
Output
3
5
8
10
13
Input
1 3
10
1
2
100
Output
10
20
1000

B. Bulldozer
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5
1 1 2 1 1
Output
2
Input
5
1 4 3 1 1
Output
7
Input
9
1 0 0 0 6 0 0 0 1
Output
5
Input
10
1 3 0 0 1 9 1 1 1 1
Output
13

C. Contest Struggles
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
2 1
70 50
Output
90.0000000
Input
10 3
80 90
Output
75.7142857
Input
2 1
100 10
Output
impossible

D. Dragon Balls
time limit per test
9 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
1
4 3
Output
5
Input
2
4 3
5 5
Output
12

E. Endgame
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
2
2 1
1 2
1 0
0 -1
Output
Bob wins
Input
3
2 3
1 3
-2 1
1 1
1 0
Output
tie 3 2
Input
4
1 1
3 4
0 3
2 0
0 -3
-2 0
Output
Alice wins

F. Flight Collision
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3
10 15
30 5
50 -1
Output
1
3 
Input
6
0 3
2 2
3 1
4 3
5 2
6 3
Output
2
1 6 

G. Great Expectations
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
100 111 5
20 0.5 10
80 0.5 2
85 0.5 2
90 0.5 2
95 0.5 2
Output
124.00000000
Input
2 4 1
1 0.5 5
Output
3.00000002
Input
10 20 3
5 0.3 8
6 0.8 3
8 0.9 3
Output
18.90298507
Input
10 50 1
5 0.5 30
Output
15.00000000

H. Hot Springs
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3
1 3 4
Output
3 1 4 
Input
6
0 0 1 -1 -6 3
Output
0 0 -1 1 -6 3 

I. Island Tour
time limit per test
7 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
6
1 1 1 1 1 1
2 1 3 2 3 1
8 7 4 9 7 2
7 6 2 9 2 1
Output
1 5 6
Input
4
1 1 1 1
1 1 1 1
10 3 2 1
4 2 5 1
Output
impossible

J. Joint Excavation
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 2
3 1
2 1
Output
1 1
1 
2 
3 
Input
4 3
1 3
2 3
3 4
Output
2 1
1 3 
4 
2 
Input
7 7
1 2
2 3
4 2
2 5
4 5
6 7
7 2
Output
3 2
1 2 4 
6 7 
3 5 

K. Keyboardd
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
this is very annoying
thiss iss veery annoying
Output
es
Input
so sticky
ssoo ssttiicckkyy
Output
cikosty