Codeforces Round 522 (Div. 1, based on Technocup 2019 Elimination Round 3)


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

Examples
Input
1 1 -3
0 3 3 0
Output
4.2426406871
Input
3 1 -9
0 3 3 -1
Output
6.1622776602
----------------------------------------------------------------------------------------------------
B. The Unbearable Lightness of Weights
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 4 2 2
Output
2
Input
6
1 2 4 4 4 9
Output
2
----------------------------------------------------------------------------------------------------
C. Vasya and Maximum Matching
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2
1 3
1 4
Output
4
Input
4
1 2
2 3
3 4
Output
6
Input
1
Output
1
----------------------------------------------------------------------------------------------------
D. Chattering
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1 4 1
Output
2 2 1 2 
Input
8
1 2 2 1 5 1 3 1
Output
3 3 2 2 1 2 2 3 
----------------------------------------------------------------------------------------------------
E. Negative Time Summation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
123456789 987654321
555555555 555555555
Output
0l1l1l0l0l0l1l1l1l0l1l0l1l1l0l0l0l1l0l1l1l1l0l0l0l1l0l0l0l0l1l0lr
----------------------------------------------------------------------------------------------------
