Educational Codeforces Round 39 (Rated for Div. 2)


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

Examples
Input
3
1 -2 0
Output
3
Input
6
16 23 16 15 42 8
Output
120
----------------------------------------------------------------------------------------------------
B. Weird Subtraction Process
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
12 5
Output
0 1
Input
31 12
Output
7 12
----------------------------------------------------------------------------------------------------
C. String Transformation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aacceeggiikkmmooqqssuuwwyy
Output
abcdefghijklmnopqrstuvwxyz
Input
thereisnoanswer
Output
-1
----------------------------------------------------------------------------------------------------
D. Timetable
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 5 1
01001
10110
Output
5
Input
2 5 0
01001
10110
Output
8
----------------------------------------------------------------------------------------------------
E. Largest Beautiful Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
89
88
1000
28923845
Output
88
77
99
28923839
----------------------------------------------------------------------------------------------------
F. Fibonacci String Subsequences
time limit per test: 3.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 4
11
Output
14
Input
10 100
1010101010
Output
553403224
----------------------------------------------------------------------------------------------------
G. Almost Increasing Array
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
5 4 3 2 1
Output
3
Input
5
1 2 8 9 5
Output
0
----------------------------------------------------------------------------------------------------
