Codeforces Round 803 (Div. 2)


A. XOR Mixup
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4
4 3 2 5
5
6 1 10 7 10
6
6 6 6 6 6 6
3
100 100 0
Output
3
7
6
0
----------------------------------------------------------------------------------------------------
B. Rising Sand
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
5 2
2 9 2 4 1
4 4
1 3 2 1
3 1
1 3 1
Output
2
0
1
----------------------------------------------------------------------------------------------------
C. 3SUM Closure
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
-1 0 1
5
1 -2 -2 1 -3
6
0 0 0 0 0 0
4
-1 2 -3 4
Output
YES
NO
YES
NO
----------------------------------------------------------------------------------------------------
D. Fixed Point Guessing
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
1 2 4 5
1 3 5
3
1
Output
? 1 4
? 3 5
! 2
? 1 1
! 1
----------------------------------------------------------------------------------------------------
E. PermutationForces II
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
3 1
2 1 3
3 -1 -1
3 2
2 1 3
3 -1 -1
4 1
1 4 3 2
4 3 1 2
6 4
4 2 6 3 1 5
6 1 5 -1 3 -1
7 4
1 3 6 2 7 4 5
2 5 -1 -1 -1 4 -1
14 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Output
1
2
0
2
12
331032489
----------------------------------------------------------------------------------------------------
F. Equal Reversal
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
8
1 2 4 3 1 2 1 1
1 1 3 4 2 1 2 1
7
1 2 3 1 3 2 3
1 3 2 3 1 2 3
3
1 1 2
1 2 1
2
1 2
2 1
1
1
1
Output
YES
2
5 8
1 6
YES
2
1 4
3 6
NO
NO
YES
0
----------------------------------------------------------------------------------------------------
G. Long Binary String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
1 2
Input
001
Output
3 4
Input
1111
Output
1 5
Input
00000
Output
-1
Input
00000111110000011111000001111101010
Output
6 37452687
----------------------------------------------------------------------------------------------------
