Codeforces Beta Round 34 (Div. 2)


A. Reconnaissance 2
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
10 12 13 15 10
Output
5 1
Input
4
10 20 30 40
Output
1 2
----------------------------------------------------------------------------------------------------
B. Sale
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3
-6 0 35 -2 4
Output
8
Input
4 2
7 0 0 -7
Output
7
----------------------------------------------------------------------------------------------------
C. Page Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1,2,3,1,1,2,6,6,2
Output
1-3,6
Input
3,2,1
Output
1-3
Input
30,20,10
Output
10,20,30
----------------------------------------------------------------------------------------------------
D. Road Map
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2 3
2 2
Output
2 3 
Input
6 2 4
6 1 2 4 2
Output
6 4 1 4 2 
----------------------------------------------------------------------------------------------------
E. Collisions
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 9
3 4 5
0 7 8
Output
68.538461538
44.538461538
Input
3 10
1 2 3
4 -5 6
7 -8 9
Output
-93.666666667
-74.666666667
-15.666666667
----------------------------------------------------------------------------------------------------
