Codeforces Round 752 (Div. 2)


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

Examples
Input
4
3
1 3 4
5
1 2 5 7 4
1
1
3
69 6969 696969
Output
1
3
0
696966
----------------------------------------------------------------------------------------------------
B. XOR Specia-LIS-t
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
7
1 3 4 2 2 1 5
3
1 3 4
5
1 3 2 4 2
4
4 3 2 1
Output
YES
NO
YES
YES
----------------------------------------------------------------------------------------------------
C. Di-visible Confusion
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 2 3
1
2
2
7 7
10
384836991 191890310 576823355 782177068 404011431 818008580 954291757 160449218 155374934 840594328
8
6 69 696 69696 696969 6969696 69696969 696969696
Output
YES
NO
YES
YES
NO
----------------------------------------------------------------------------------------------------
D. Moderate Modular Mode
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4 8
4 2
420 420
69420 42068
Output
4
10
420
9969128
----------------------------------------------------------------------------------------------------
E. Extreme Extension
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
5 4 3
4
3 2 1 4
1
69
8
7264 40515 28226 92776 35285 21709 75124 48163
Output
5
9
0
117
----------------------------------------------------------------------------------------------------
F. Artistic Partition
time limit per test: 3 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
4
6 2
4 4
3 1
10 3
Output
8
4
6
11
----------------------------------------------------------------------------------------------------
