Codeforces Round 683 (Div. 1, by Meet IT)


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

Examples
Input
3
1 3
3
6 2
19 8 19 69 9 4
7 12
1 1 1 17 1 1 1
Output
1
1
-1
6
1 2 3 5 6 7
----------------------------------------------------------------------------------------------------
B. Catching Cheaters
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5
abba
babab
Output
5
Input
8 10
bbbbabab
bbbabaaaaa
Output
12
Input
7 7
uiibwws
qhtkxcn
Output
0
----------------------------------------------------------------------------------------------------
C. Xor Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
0 1 5 2 6
Output
1
Input
7
6 9 8 7 3 5 2
Output
2
----------------------------------------------------------------------------------------------------
D1. Frequency Problem (Easy Version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 1 2 2 3 3 3
Output
6
Input
10
1 1 1 5 4 1 3 1 2 2
Output
7
Input
1
1
Output
0
----------------------------------------------------------------------------------------------------
D2. Frequency Problem (Hard Version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 1 2 2 3 3 3
Output
6
Input
10
1 1 1 5 4 1 3 1 2 2
Output
7
Input
1
1
Output
0
----------------------------------------------------------------------------------------------------
E. Long Recovery
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 0
1 0
2 0
0 1
Output
RECOVERED
4
Input
3
1 0
3 0
1 1
Output
SICK
----------------------------------------------------------------------------------------------------
F. Line Distance
time limit per test: 7.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
2 1
-2 -1
0 -1
-2 4
Output
0.707106780737
----------------------------------------------------------------------------------------------------
