Codeforces Round 160 (Div. 1)


A. 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
----------------------------------------------------------------------------------------------------
B. 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
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. Maxim and Increasing Subsequence
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
2 10 3
Output
1
Input
2 111 100
Output
106
Input
2 111 11
Output
47
----------------------------------------------------------------------------------------------------
