Codeforces Round 948 (Div. 2)


A. Little Nikita
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 3
2 4
5 3
Output
Yes
No
Yes
----------------------------------------------------------------------------------------------------
B. Binary Colouring
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1
14
24
15
27
11
19
Output
1
1
5
0 -1 0 0 1
6
0 0 0 -1 0 1
5
-1 0 0 0 1
6
-1 0 -1 0 0 1
5
-1 0 -1 0 1
5
-1 0 1 0 1
----------------------------------------------------------------------------------------------------
C. Nikita and LCM
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
5
1 2 4 8 16
6
3 2 10 20 60 1
7
2 3 4 6 12 100003 1200036
9
2 42 7 3 6 7 7 1 6
8
4 99 57 179 10203 2 11 40812
1
1
Output
0
4
4
5
8
0
----------------------------------------------------------------------------------------------------
D. XORificator
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 4
1010
0110
0100
1 1
1
1 1
0
2 5
00101
10110
3 3
101
111
000
Output
3
010
1
0
1
1
3
00
2
010
----------------------------------------------------------------------------------------------------
E. Tensor
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
YES
YES
YES
NO
NO
NO
5
Output
? 1 2
? 2 3
? 1 3
? 1 4
? 2 4
? 3 4
! 0 0 0 1
! 1 1 0 1 0
----------------------------------------------------------------------------------------------------
