Codeforces Round 362 (Div. 1)


A. Lorenzo Von Matterhorn
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 3 4 30
1 4 1 2
1 3 6 8
2 4 3
1 6 1 40
2 3 7
2 2 4
Output
94
0
32
----------------------------------------------------------------------------------------------------
B. Puzzles
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 2 1 1 4 4
Output
1.0 4.0 5.0 3.5 4.5 5.0 5.0 
Input
12
1 1 2 2 4 4 3 3 1 10 8
Output
1.0 5.0 5.5 6.5 7.5 8.0 8.0 7.0 7.5 6.5 7.5 8.0 
----------------------------------------------------------------------------------------------------
C. PLEASE
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
2
Output
1/2
Input
3
1 1 1
Output
0/1
----------------------------------------------------------------------------------------------------
D. Legen...
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 6
3 2 1
heart
earth
art
Output
6
Input
3 6
3 2 8
heart
earth
art
Output
16
----------------------------------------------------------------------------------------------------
E. ...Wait for it...
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 7 11
3 5
2 3
4 3
1 4
4 1 4 5 4 1 4
2 4 3
1 2 1 2
1 4 2 1
2 2 10
2 1 10
1 2 4 1
1 2 3 4
2 5 2
2 4 9
1 3 5 2
1 1 2 3
Output
2 2 1 
1 3 
1 5 
0 
1 4 
2 6 7 
----------------------------------------------------------------------------------------------------
F. ...Dary!
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
-41 67
-16 20
25 25
-36 85
Output
0
-16 20
-36 85
Input
7
-7 54
-5 31
-2 17
20 19
32 23
34 27
26 57
Output
2.9342248
32.019503 23.0390067
-6.929116 54.006444
----------------------------------------------------------------------------------------------------
