Codeforces Round 105 (Div. 2)


A. Insomnia cure
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
2
3
4
12
Output
12
Input
2
3
4
5
24
Output
17
----------------------------------------------------------------------------------------------------
B. Escape
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
2
1
1
10
Output
2
Input
1
2
1
1
8
Output
1
----------------------------------------------------------------------------------------------------
C. Terse princess
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 2 3
Output
5 1 3 6 16 35 46 4 200 99
Input
5 0 0
Output
10 10 6 6 5
----------------------------------------------------------------------------------------------------
D. Bag of mice
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 3
Output
0.500000000
Input
5 5
Output
0.658730159
----------------------------------------------------------------------------------------------------
E. Porcelain
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
3 3 7 2
3 4 1 5
Output
15
Input
1 3
4 4 3 1 2
Output
9
----------------------------------------------------------------------------------------------------
