Codeforces Round 204 (Div. 1)


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

Examples
Input
3
0.000 0.500 0.750 1.000 2.000 3.000
Output
0.250
Input
3
4469.000 6526.000 4864.000 9356.383 7490.000 995.896
Output
0.279
----------------------------------------------------------------------------------------------------
B. Jeff and Furik
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2
Output
0.000000
Input
5
3 5 2 4 1
Output
13.000000
----------------------------------------------------------------------------------------------------
C. Jeff and Brackets
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 6
1 2
2 1
Output
12
Input
1 10000000
2
3
Output
25000000
----------------------------------------------------------------------------------------------------
D. Jeff and Removing Periods
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
2 2 1 1 2
5
1 5
1 1
2 2
1 3
2 3
Output
2
1
1
2
2
Input
10
2 1 3 3 3 3 1 3 1 1
10
4 8
2 10
1 10
4 4
1 3
2 4
6 7
1 9
2 5
1 1
Output
2
3
3
1
3
2
2
3
2
1
----------------------------------------------------------------------------------------------------
E. Jeff and Permutation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2 1
Output
0
Input
9
-2 0 -1 0 -1 2 1 0 -1
Output
6
----------------------------------------------------------------------------------------------------
