Codeforces Round 265 (Div. 2)


A. inc ARG
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1100
Output
3
Input
4
1111
Output
4
----------------------------------------------------------------------------------------------------
B. Inbox (100500)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
0 1 0 1 0
Output
3
Input
5
1 1 0 0 1
Output
4
Input
2
0 0
Output
0
----------------------------------------------------------------------------------------------------
C. No to Palindromes!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
cba
Output
NO
Input
3 4
cba
Output
cbd
Input
4 4
abcd
Output
abda
----------------------------------------------------------------------------------------------------
D. Restore Cube
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0 0
0 0 1
0 0 1
0 0 1
0 1 1
0 1 1
0 1 1
1 1 1
Output
YES
0 0 0
0 0 1
0 1 0
1 0 0
0 1 1
1 0 1
1 1 0
1 1 1
Input
0 0 0
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
1 1 1
Output
NO
----------------------------------------------------------------------------------------------------
E. Substitutes in Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
123123
1
2->00
Output
10031003
Input
123123
1
3->
Output
1212
Input
222
2
2->0
0->7
Output
777
Input
1000000008
0
Output
1
----------------------------------------------------------------------------------------------------
