Codeforces Round 253 (Div. 1)


A. Borya and Hanabi
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
G3 G3
Output
0
Input
4
G4 R4 R3 B3
Output
2
Input
5
B1 Y1 W1 G1 R1
Output
4
----------------------------------------------------------------------------------------------------
B. Andrey and Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0.1 0.2 0.3 0.8
Output
0.800000000000
Input
2
0.1 0.2
Output
0.260000000000
----------------------------------------------------------------------------------------------------
C. Artem and Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 1 5 2 6
Output
11
Input
5
1 2 3 4 5
Output
6
Input
5
1 100 101 100 1
Output
102
----------------------------------------------------------------------------------------------------
D. Adam and Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
11
1 1 1 3 4 4 7 3 7 6 6
Output
1 1 1 1 1 2 2 2 2 2 3 
----------------------------------------------------------------------------------------------------
E. Gena and Second Distance
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 5 4
0 0
5 0
0 5
5 5
Output
4.99999999941792339
Input
5 5 3
4 0
2 5
4 1
Output
5.65685424744772014
----------------------------------------------------------------------------------------------------
