Codeforces Round 773 (Div. 2)


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

Examples
Input
5
8 10
10 4
6 2
4 6
0 1
4 2
14 1
11 2
13 2
0 0
4 0
2 4
0 1
1 1
0 0
Output
0.0000000
0
2.0000
0.00
1
----------------------------------------------------------------------------------------------------
B. Power Walking
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3
1 1 2
6
5 1 2 2 2 4
Output
2 2 3 
4 4 4 4 5 6 
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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
----------------------------------------------------------------------------------------------------
E. 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
----------------------------------------------------------------------------------------------------
F. 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
----------------------------------------------------------------------------------------------------
