Codeforces Round 409 (rated, Div. 2, based on VK Cup 2017 Round 2)


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

Examples
Input
VK
Output
1
Input
VV
Output
1
Input
V
Output
0
Input
VKKKKKKKKKVVVVVVVVVK
Output
3
Input
KVKV
Output
1
----------------------------------------------------------------------------------------------------
B. Valued Keys
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ab
aa
Output
ba
Input
nzwzl
niwel
Output
xiyez
Input
ab
ba
Output
-1
----------------------------------------------------------------------------------------------------
C. Voltage Keepsake
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
2 2
2 1000
Output
2.0000000000
Input
1 100
1 1
Output
-1
Input
3 5
4 3
5 2
6 1
Output
0.5000000000
----------------------------------------------------------------------------------------------------
D. Volatile Kite
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 0
0 1
1 1
1 0
Output
0.3535533906
Input
6
5 0
10 0
12 -4
10 -8
5 -8
3 -4
Output
1.0000000000
----------------------------------------------------------------------------------------------------
E. Vulnerable Kerbals
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 5
Output
5
1 2 4 3 0
Input
3 10
2 9 1
Output
6
3 9 2 9 8 0
----------------------------------------------------------------------------------------------------
