Codeforces Round 773 (Div. 1)


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

Examples
Input
4
4 4
1 16 4 4
6 2
1 2 2 2 4 7
5 3
5 2 3 5 15
9 10
10 10 10 20 1 100 200 2000 3
Output
0
2
3
3
----------------------------------------------------------------------------------------------------
B. Repetitions Decoding
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2
5 7
2
5 5
6
1 3 1 2 2 3
6
3 2 1 1 2 3
Output
-1
0
1
2
4
1 3
5 3
5 3
10 3
2
8 6 
5
0 3
8 3
5 3 
6 2 
7 1
4
2 6 6 2
----------------------------------------------------------------------------------------------------
C. Anonymity Is Important
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 9
0 4 5 0
1 5
1 6
0 4 6 1
1 6
0 2 5 1
0 2 2 0
1 3
1 2
Output
NO
N/A
YES
YES
NO
----------------------------------------------------------------------------------------------------
D. Two Arrays
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 2
1 2 5
4 3 1
2 3 2
4 5 3
Output
5
Input
4 3
1 2 3 5
2 3 4 2
3 4 5 3
1 3 10 10
Output
-1
----------------------------------------------------------------------------------------------------
E. Special Positions
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 2
1 2 3 4
1 4
Output
665496247
Input
6 6
4 2 4 2 4 2
1 2 3 4 5 6
Output
855638030
----------------------------------------------------------------------------------------------------
F. Covering Circle
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 2 2
0 0
0 4
3 0
5 4 3
1 1
0 0
2 2
0 2
2 0
8 3 2
0 3
1 0
0 2
1 1
0 1
1 2
0 0
1 3
5 4 4
1 1
-3 3
2 2
5 3
5 5
Output
2.00000000000000000000
1.00000000000000000000
0.50000000000000000000
4.00000000000000000000
----------------------------------------------------------------------------------------------------
