Codeforces Round 272 (Div. 1)


A. Dreamoon and Sums
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
0
Input
2 2
Output
8
----------------------------------------------------------------------------------------------------
B. Dreamoon and Sets
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
5
1 2 3 5
Input
2 2
Output
22
2 4 6 22
14 18 10 16
----------------------------------------------------------------------------------------------------
C. Dreamoon and Strings
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aaaaa
aa
Output
2 2 1 1 0 0
Input
axbaxxb
ab
Output
0 1 1 2 1 1 0 0
----------------------------------------------------------------------------------------------------
D. Dreamoon and Binary
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
101
Output
1
6
Input
11010
Output
3
5
----------------------------------------------------------------------------------------------------
E. Dreamoon and Notepad
time limit per test: 3.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
1 3 5 3 1 3 5 3 1
4
3 5 3 1
3 3 7 3
1 0 3 3
6 0 7 3
Output
2
5
3
2
Input
2
10 5
1
1 0 1 5
Output
3
----------------------------------------------------------------------------------------------------
