Codeforces Round 702 (Div. 3)


A. Dense Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
4
4 2 10 1
2
1 3
2
6 1
3
1 4 2
5
1 2 3 4 3
12
4 31 25 50 30 20 34 46 42 16 15 16
Output
5
1
2
1
0
3
----------------------------------------------------------------------------------------------------
B. Balanced Remainders
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
6
0 2 5 5 4 8
6
2 0 2 1 0 0
9
7 1 3 4 2 10 3 9 6
6
0 1 2 3 4 5
Output
3
1
3
0
----------------------------------------------------------------------------------------------------
C. Sum of Cubes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1
2
4
34
35
16
703657519796
Output
NO
YES
NO
NO
YES
YES
YES
----------------------------------------------------------------------------------------------------
D. Permutation Transformation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
5
3 5 2 1 4
1
1
4
4 3 1 2
Output
1 0 2 3 1 
0 
0 1 3 2 
----------------------------------------------------------------------------------------------------
E. Accidental Victory
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1 2 4 3
5
1 1 1 1 1
Output
3
2 3 4 
5
1 2 3 4 5 
----------------------------------------------------------------------------------------------------
F. Equalize the Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
6
1 3 2 1 4 2
4
100 100 4 100
8
1 2 3 3 3 2 6 6
Output
2
1
2
----------------------------------------------------------------------------------------------------
G. Old Floppy Drive
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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