Codeforces Round 373 (Div. 2)


A. Vitya in the Countryside
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 4 5 6 7
Output
UP
Input
7
12 13 14 15 14 13 12
Output
DOWN
Input
1
8
Output
-1
----------------------------------------------------------------------------------------------------
B. Anatoly and Cockroaches
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
rbbrr
Output
1
Input
5
bbbbb
Output
2
Input
3
rbr
Output
0
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
E. 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
----------------------------------------------------------------------------------------------------
