Codeforces Round 176 (Div. 2)


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

Examples
Input
####
.#..
####
....
Output
YES
Input
####
....
####
....
Output
NO
----------------------------------------------------------------------------------------------------
B. Pipeline
time limit per test: 0.4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
Output
2
Input
5 5
Output
1
Input
8 4
Output
-1
----------------------------------------------------------------------------------------------------
C. Lucky Permutation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
1 
Input
2
Output
-1
Input
4
Output
2 4 1 3 
Input
5
Output
2 5 3 1 4 
----------------------------------------------------------------------------------------------------
D. Shifting
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 
Input
4
Output
4 2 3 1 
----------------------------------------------------------------------------------------------------
E. Main Sequence
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 1
0
Output
YES
1 -1
Input
4
1 1 1 1
1 3
Output
YES
1 1 -1 -1
Input
3
1 1 1
0
Output
NO
Input
4
1 2 2 1
2 3 4
Output
YES
1 2 -2 -1
----------------------------------------------------------------------------------------------------
