Codeforces Round 901 (Div. 2)


A. Jellyfish and Undertale
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5 3 3
1 1 7
7 1 5
1 2 5 6 8
Output
9
21
----------------------------------------------------------------------------------------------------
B. Jellyfish and Game
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 2 1
1 2
3 4
1 1 10000
1
2
4 5 11037
1 1 4 5
1 9 1 9 8
1 1 1
2
1
Output
6
1
19
2
----------------------------------------------------------------------------------------------------
C. Jellyfish and Green Apple
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
10 5
1 5
10 4
3 4
Output
0
-1
2
5
----------------------------------------------------------------------------------------------------
D. Jellyfish and Mex
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
8
5 2 1 0 3 0 4 0
2
1 2
5
1 0 2 114514 0
8
0 1 2 0 1 2 0 3
Output
3
0
2
7
----------------------------------------------------------------------------------------------------
E. Jellyfish and Math
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
10
1 0 1 1 1
3 3 1 2 1
1 6 0 7 1
2 4 4 9 8
21 4 0 17 28
50 50 0 0 39
95 33 1 33 110
138 202 174 64 108
78 340 68 340 461
457 291 491 566 766
Output
1
-1
2
-1
-1
2
1
4
1
3
----------------------------------------------------------------------------------------------------
F. Jellyfish and EVA
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
3 2
1 2
1 3
7 8
1 2
1 3
1 4
1 5
2 6
3 6
4 6
6 7
10 20
1 2
1 3
1 4
1 5
1 6
2 6
2 7
2 8
2 9
3 4
3 7
3 8
3 10
4 6
4 8
4 10
6 10
7 8
7 9
7 10
Output
0.500000000000
0.625000000000
0.491666666667
----------------------------------------------------------------------------------------------------
G. Jellyfish and Miku
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 8
Output
5.200000000000
Input
10 98
Output
37.721155173329
----------------------------------------------------------------------------------------------------
