Codeforces Round 188 (Div. 2)


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

Examples
Input
10 3
Output
5
Input
7 7
Output
6
----------------------------------------------------------------------------------------------------
B. Strings of Power
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
heavymetalisheavymetal
Output
3
Input
heavymetalismetal
Output
2
Input
trueheavymetalissotruewellitisalsosoheavythatyoucanalmostfeeltheweightofmetalonyou
Output
3
----------------------------------------------------------------------------------------------------
C. Perfect Pair
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 5
Output
2
Input
-1 4 15
Output
4
Input
0 -1 5
Output
-1
----------------------------------------------------------------------------------------------------
D. Ants
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 3
0 1
0 0
0 -1
Output
0
1
0
Input
6 5
0 -2
0 -1
0 0
0 1
0 2
Output
0
1
2
1
0
----------------------------------------------------------------------------------------------------
E. Balance
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10 1
1 9
5 5
1 2
Output
1
2 1 4
Input
2 10 0
5 2
4 2
Output
NO
Input
2 10 0
4 2
4 2
Output
0
----------------------------------------------------------------------------------------------------
