Codeforces Round 373 (Div. 1)


A. Efim and Strange Grade
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 1
10.245
Output
10.25
Input
6 2
10.245
Output
10.3
Input
3 100
9.2
Output
9.2
----------------------------------------------------------------------------------------------------
C. Sasha and Array
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
1 1 2 1 1
2 1 5
1 2 4 2
2 2 4
2 1 5
Output
5
7
9
----------------------------------------------------------------------------------------------------
D. Andrew and Chemistry
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2
2 3
2 4
Output
2
Input
5
1 2
1 3
1 4
1 5
Output
1
Input
5
2 5
5 3
4 3
4 1
Output
3
----------------------------------------------------------------------------------------------------
E. Matvey's Birthday
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
abc
Output
2 1
Input
7
aaabaaa
Output
2 4
----------------------------------------------------------------------------------------------------
