Codeforces Beta Round 52 (Div. 2)


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

Examples
Input
5
18
VODKA
COKE
19
17
Output
2
----------------------------------------------------------------------------------------------------
B. Spoilt Permutation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8
1 6 5 4 3 2 7 8
Output
2 6
Input
4
2 3 4 1
Output
0 0
Input
4
1 2 3 4
Output
0 0
----------------------------------------------------------------------------------------------------
C. Corporation Mail
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
MIKE:MAX.,ARTEM:MIKE..,DMITRY:DMITRY.,DMITRY...
Output
3
Input
A:A..
Output
1
Input
A:C:C:C:C.....
Output
6
----------------------------------------------------------------------------------------------------
D. Changing a String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ABA
ABBBA
Output
2
INSERT 3 B
INSERT 4 B
Input
ACCEPTED
WRONGANSWER
Output
10
REPLACE 1 W
REPLACE 2 R
REPLACE 3 O
REPLACE 4 N
REPLACE 5 G
REPLACE 6 A
INSERT 7 N
INSERT 8 S
INSERT 9 W
REPLACE 11 R
----------------------------------------------------------------------------------------------------
E. Domino Principle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
16 5
20 5
10 10
18 2
Output
3 1 4 1 
Input
4
0 10
1 5
9 10
15 10
Output
4 1 2 1 
----------------------------------------------------------------------------------------------------
