Codeforces Round 134 (Div. 2)


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

Examples
Input
3 2
0 5 3 5 1 5 2
Output
0 5 3 4 1 4 2 
Input
1 1
0 2 0
Output
0 1 0 
----------------------------------------------------------------------------------------------------
B. Airport
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

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

Examples
Input
6 10
Output
2
TBBTTB
Input
4 5
Output
0
TBTB
Input
2 1
Output
IMPOSSIBLE
----------------------------------------------------------------------------------------------------
E. Formurosa
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
(?^?)
Output
NO
Input
10
?
Output
YES
Input
2
((?^?)&?)
Output
YES
----------------------------------------------------------------------------------------------------
