Codeforces Beta Round 57 (Div. 2)


A. Ultra-Fast Mathematician
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1010100
0100101
Output
1110001
Input
000
111
Output
111
Input
1110
1010
Output
0100
Input
01110
01100
Output
00010
----------------------------------------------------------------------------------------------------
B. Hard Work
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
Iran_
Persian;
W_o;n;d;e;r;f;u;l;
7
WonderfulPersianIran
wonderful_PersIAN_IRAN;;_
WONDERFUL___IRAN__PERSIAN__;;
Ira__Persiann__Wonderful
Wonder;;fulPersian___;I;r;a;n;
__________IranPersianWonderful__________
PersianIran_is_Wonderful
Output
ACC
ACC
ACC
WA
ACC
ACC
WA
Input
Shapur;;
is___
a_genius
3
Shapur__a_is___geniUs
is___shapur___a__Genius;
Shapur;;is;;a;;geni;;us;;
Output
WA
ACC
ACC
----------------------------------------------------------------------------------------------------
C. Capture Valerian
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 2
1
Output
1
Input
16 R
5
Output
V
Input
5 R
4
Output
IV
Input
2 2
1111001
Output
1111001
Input
12 13
A
Output
A
----------------------------------------------------------------------------------------------------
D. Eternal Victory
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
2 3 4
Output
7
Input
3
1 2 3
1 3 3
Output
9
----------------------------------------------------------------------------------------------------
E. Enemy is weak
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 2 1
Output
1
Input
3
2 3 1
Output
0
Input
4
10 8 3 1
Output
4
Input
4
1 5 4 3
Output
1
----------------------------------------------------------------------------------------------------
