Codeforces Round 213 (Div. 2)


A. Good Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
Output
10
Input
2 1
1
10
Output
1
----------------------------------------------------------------------------------------------------
B. The Fibonacci Segment
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10
1 2 3 5 8 13 21 34 55 89
Output
10
Input
5
1 1 1 1 1
Output
2
----------------------------------------------------------------------------------------------------
C. Matrix
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10
12345
Output
6
Input
16
439873893693495623498263984765
Output
40
----------------------------------------------------------------------------------------------------
D. Free Market
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
1 3 10
Output
4 3
Input
3 5
1 2 3
Output
6 2
Input
10 10000
10000 9999 1 10000 10000 10000 1 2 3 4
Output
50010 6
----------------------------------------------------------------------------------------------------
E. Beautiful Set
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10
Output
16 18 24 27 36 48 54 72 108 144 
----------------------------------------------------------------------------------------------------
