Codeforces Round 698 (Div. 2)


A. Nezzar and Colorful Balls
time limit per test: 1 second
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
6
1 1 1 2 3 4
5
1 1 2 2 3
4
2 2 2 2
3
1 2 3
1
1
Output
3
2
4
1
1
----------------------------------------------------------------------------------------------------
B. Nezzar and Lucky Number
time limit per test: 1 second
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
2
3 7
24 25 27
10 7
51 52 53 54 55 56 57 58 59 60
Output
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
----------------------------------------------------------------------------------------------------
C. Nezzar and Symmetric Array
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
6
2
8 12 8 12
2
7 7 9 11
2
7 11 7 11
1
1 1
4
40 56 48 40 80 56 80 48
6
240 154 210 162 174 154 186 240 174 186 162 210
Output
YES
NO
NO
NO
NO
YES
----------------------------------------------------------------------------------------------------
D. Nezzar and Board
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
6
2 1
1 2
3 0
2 3 7
2 -1
31415926 27182818
2 1000000000000000000
1 1000000000000000000
2 -1000000000000000000
-1000000000000000000 123
6 80
-5 -20 13 -14 -2 -11
Output
YES
YES
NO
YES
YES
NO
----------------------------------------------------------------------------------------------------
E. Nezzar and Binary String
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
5 2
00000
00111
1 5
1 3
2 1
00
01
1 2
10 6
1111111111
0110001110
1 10
5 9
7 10
1 7
3 5
6 10
5 2
10000
11000
2 5
1 3
Output
YES
NO
YES
NO
----------------------------------------------------------------------------------------------------
F. Nezzar and Nice Beatmap
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

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