Codeforces Round 673 (Div. 2)


A. Copy-paste
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 2
1 1
3 5
1 2 3
3 7
3 2 2
Output
1
5
4
----------------------------------------------------------------------------------------------------
B. Two Arrays
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
6 7
1 2 3 4 5 6
3 6
3 3 3
Output
1 0 0 1 1 0 
1 0 0
----------------------------------------------------------------------------------------------------
C. k-Amazing Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
5
1 2 3 4 5
5
4 4 4 4 2
6
1 3 1 5 3 1
Output
-1 -1 3 2 1 
-1 4 4 4 2 
-1 -1 1 1 1 1 
----------------------------------------------------------------------------------------------------
D. Make Them Equal
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
2 16 4 18
6
1 2 3 4 5 6
5
11 19 1 1 3
Output
2
4 1 2
2 3 3
-1
4
1 2 4
2 4 5
2 3 3
4 5 1
----------------------------------------------------------------------------------------------------
E. XOR Inverse
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
0 1 3 2
Output
1 0
Input
9
10 7 9 10 7 5 5 3 5
Output
4 14
Input
3
8 10 3
Output
0 8
----------------------------------------------------------------------------------------------------
F. Graph and Queries
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4 6
1 2 5 4 3
1 2
2 3
1 3
4 5
1 1
2 1
2 3
1 1
1 2
1 2
Output
5
1
2
0
----------------------------------------------------------------------------------------------------
