Codeforces Round 176 (Div. 1)


A. 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 
----------------------------------------------------------------------------------------------------
B. 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 
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. Tourists
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2
1 4 3
3 6 5
0 1
Output
2
4
Input
3 3
0 3 4
0 1 2
2 4 0
1 3 4
Output
2
4
4
----------------------------------------------------------------------------------------------------
E. Ladies' Shop
time limit per test: 8 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 10
5 6 7 8 9 10
Output
YES
5
5 6 7 8 9 
Input
1 10
1
Output
NO
Input
1 10
6
Output
YES
1
6 
----------------------------------------------------------------------------------------------------
