Codeforces Round 160 (Div. 2)


A. Roma and Lucky Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4
1 2 4
Output
3
Input
3 2
447 44 77
Output
2
----------------------------------------------------------------------------------------------------
B. Roma and Changing Signs
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
-1 -1 1
Output
3
Input
3 1
-1 -1 1
Output
1
----------------------------------------------------------------------------------------------------
C. Maxim and Discounts
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
2
4
50 50 100 100
Output
200
Input
2
2 3
5
50 50 50 50 50
Output
150
Input
1
1
7
1 1 1 1 1 1 1
Output
3
----------------------------------------------------------------------------------------------------
D. Maxim and Restaurant
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
3
Output
1.3333333333
----------------------------------------------------------------------------------------------------
E. Maxim and Matrix
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
1
Input
3 2
Output
1
Input
3 3
Output
0
Input
1000000000000 1048576
Output
118606527258
----------------------------------------------------------------------------------------------------
