Codeforces Round 153 (Div. 2)


A. Little Xor
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2 1 1 2
Output
3
Input
3
1 2 7
Output
7
Input
4
4 2 4 8
Output
14
----------------------------------------------------------------------------------------------------
B. Unsorting Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1
Output
-1
Input
2
1 2
Output
-1
Input
4
1 2 3 4
Output
1 2
Input
3
1 1 1
Output
-1
----------------------------------------------------------------------------------------------------
C. Points on Line
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
1 2 3 4
Output
4
Input
4 2
-3 -2 -1 0
Output
2
Input
5 19
1 10 20 30 50
Output
1
----------------------------------------------------------------------------------------------------
D. Playing with Permutations
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 1
2 3 4 1
1 2 3 4
Output
NO
Input
4 1
4 3 1 2
3 4 2 1
Output
YES
Input
4 3
4 3 1 2
3 4 2 1
Output
YES
Input
4 2
4 3 1 2
2 1 4 3
Output
YES
Input
4 1
4 3 1 2
2 1 4 3
Output
NO
----------------------------------------------------------------------------------------------------
E. Number Transformation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 1 4
Output
6
Input
6 3 10
Output
2
Input
1000000000000000000 1 3
Output
666666666666666667
----------------------------------------------------------------------------------------------------
