Codeforces Round 565 (Div. 3)


A. Divide it!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1
10
25
30
14
27
1000000000000000000
Output
0
4
6
6
-1
6
72
----------------------------------------------------------------------------------------------------
B. Merge it!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
3 1 2 3 1
7
1 1 1 1 1 2 2
Output
3
3
----------------------------------------------------------------------------------------------------
C. Lose it!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
4 8 15 16 23
Output
5
Input
12
4 8 4 15 16 8 23 15 16 42 23 42
Output
0
Input
15
4 8 4 8 15 16 8 16 23 15 16 4 42 23 42
Output
3
----------------------------------------------------------------------------------------------------
D. Recover it!
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 5 2 3 2 4
Output
3 4 2 
Input
1
2750131 199999
Output
199999 
Input
1
3 6
Output
6 
----------------------------------------------------------------------------------------------------
E. Cover it!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4 6
1 2
1 3
1 4
2 3
2 4
3 4
6 8
2 5
5 4
4 3
4 1
1 3
2 3
2 6
5 6
Output
2
1 3
3
4 3 6
----------------------------------------------------------------------------------------------------
F. Destroy it!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 6
1 7
1 5
2
1 4
1 3
3
1 10
3 5
2 3
3
1 15
2 4
1 10
1
1 100
Output
263
----------------------------------------------------------------------------------------------------
