Codeforces Round 148 (Div. 2)


A. Two Bags of Potatoes
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 1 10
Output
-1
Input
10 6 40
Output
2 8 14 20 26 
----------------------------------------------------------------------------------------------------
B. Easy Tape Programming
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 4
1>3>22<
1 3
4 7
7 7
1 7
Output
0 1 0 1 0 0 0 0 0 0 
2 2 2 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 
2 3 2 1 0 0 0 0 0 0 
----------------------------------------------------------------------------------------------------
C. Not Wool Sequences
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
Output
6
----------------------------------------------------------------------------------------------------
D. Boring Partition
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
1 2 3
Output
1
1 2 2 
Input
5 10
0 1 0 2 1
Output
3
2 2 2 2 2 
----------------------------------------------------------------------------------------------------
E. World Eater Brothers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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