Codeforces Round 697 (Div. 3)


A. Odd Divisor
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
2
3
4
5
998244353
1099511627776
Output
NO
YES
NO
YES
YES
NO
----------------------------------------------------------------------------------------------------
B. New Year's Number
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1
4041
4042
8081
8079
Output
NO
YES
YES
YES
NO
----------------------------------------------------------------------------------------------------
C. Ball in Berland
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 4 4
1 1 2 3
2 3 2 4
1 1 1
1
1
2 2 4
1 1 2 2
1 2 1 2
Output
4
0
2
----------------------------------------------------------------------------------------------------
D. Cleaning the Phone
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
5 7
5 3 2 1 4
2 1 1 2 1
1 3
2
1
5 10
2 3 2 3 2
1 2 1 2 1
4 10
5 1 3 4
1 2 1 2
4 5
3 2 1 2
2 1 2 1
Output
2
-1
6
4
3
----------------------------------------------------------------------------------------------------
E. Advertising Agency
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4 3
1 3 1 2
4 2
1 1 1 1
2 1
1 2
Output
2
6
1
----------------------------------------------------------------------------------------------------
F. Unusual Matrix
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3
110
001
110
000
000
000
3
101
010
101
010
101
010
2
01
11
10
10
Output
YES
YES
NO
----------------------------------------------------------------------------------------------------
G. Strange Beauty
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5
7 9 3 14 63
3
2 14 42
4
45 9 3 18
3
2 2 8
Output
2
0
1
0
----------------------------------------------------------------------------------------------------
