Codeforces Round 193 (Div. 2)


A. Down the Hatch!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
abbba
Output
1
Input
4
abbab
Output
0
----------------------------------------------------------------------------------------------------
B. Maximum Absurdity
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
3 6 1 1 6
Output
1 4
Input
6 2
1 1 1 1 1 1
Output
1 3
----------------------------------------------------------------------------------------------------
C. Students' Revenge
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3 2
5 6
5 8
1 3
4 3
4 11
Output
3 1 2 
Input
5 3 3
10 18
18 17
10 20
20 18
20 18
Output
2 4 5 
----------------------------------------------------------------------------------------------------
D. Theft of Blueprints
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 1
-1 -1 -1 8 -1
-1 5 -1 -1
-1 -1 3
-1 -1
-1
Output
5
Input
3 2
10 0
11
Output
14
----------------------------------------------------------------------------------------------------
E. Binary Key
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abacaba
aba
6
Output
100001
Input
abacaba
aba
3
Output
0
----------------------------------------------------------------------------------------------------
