Codeforces Round 253 (Div. 2)


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

Examples
Input
{a, b, c}
Output
3
Input
{b, a, b, a}
Output
2
Input
{}
Output
0
----------------------------------------------------------------------------------------------------
B. Kolya and Tandem Repeat
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aaba
2
Output
6
Input
aaabbbb
2
Output
6
Input
abracadabra
10
Output
20
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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
----------------------------------------------------------------------------------------------------
E. 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
----------------------------------------------------------------------------------------------------
