Codeforces Beta Round 46 (Div. 2)


A. Sleuth
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
Is it a melon?
Output
NO
Input
Is it an apple?
Output
YES
Input
  Is     it a banana ?
Output
YES
Input
Is   it an apple  and a  banana   simultaneouSLY?
Output
YES
----------------------------------------------------------------------------------------------------
B. Sum
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
78 87
Output
3
Input
1 1
Output
2
----------------------------------------------------------------------------------------------------
C. Disposition
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
6
111010
Output
1
Input
5
10001
Output
1
Input
7
1100010
Output
2
Input
5
00100
Output
2
----------------------------------------------------------------------------------------------------
E. Common ancestor
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ababa
aba
2
c->ba
c->cc
Output
2
Input
ababa
aba
7
c->ba
c->cc
e->ab
z->ea
b->ba
d->dd
d->ab
Output
1
Input
ababa
aba
1
c->ba
Output
-1
----------------------------------------------------------------------------------------------------
