Codeforces Beta Round 58


A. A Student's Dream
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 1
10 5
Output
YES
Input
4 5
3 3
Output
YES
Input
1 2
11 6
Output
NO
----------------------------------------------------------------------------------------------------
B. Tyndex.Brome
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10
codeforces
codeforces
codehorses
Output
0
12
Input
9 9
vkontakte
vcontacte
vkontrakte
vkollapse
vkrokodile
vtopke
vkapuste
vpechke
vk
vcodeforcese
Output
18
14
36
47
14
29
30
0
84
----------------------------------------------------------------------------------------------------
C. Inquisition
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1 1 2 1 1 2
Output
3.4142135624
Input
3
3 3 10 3 3 10
1 1 9 4 5 6
2 2 11 7 6 11
Output
37.7044021497
----------------------------------------------------------------------------------------------------
D. Wormhouse
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
1 2 3 1
Output
1 3 2 1 
Input
3 3
1 3 2 1
Output
No solution
----------------------------------------------------------------------------------------------------
E. World Evil
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4
4 4 4
1 1 5
5 5 3
4 1 2
1 3 1
3 5 4
1 4 3
Output
7
Input
2 2
9 2
2 3
6 1
Output
11
----------------------------------------------------------------------------------------------------
