Codeforces Round 144 (Div. 2)


A. Perfect 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
2 1 
Input
4
Output
2 1 4 3 
----------------------------------------------------------------------------------------------------
B. Non-square Equation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
1
Input
110
Output
10
Input
4
Output
-1
----------------------------------------------------------------------------------------------------
C. Cycles
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
3
011
101
110
Input
10
Output
5
01111
10111
11011
11101
11110
----------------------------------------------------------------------------------------------------
D. Table
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6 1
Output
45
----------------------------------------------------------------------------------------------------
E. Doe Graphs
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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