CROC 2016 - Elimination Round  (Rated Unofficial Edition)


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

Examples
Input
AB
XC
XB
AC
Output
YES
Input
AB
XC
AC
BX
Output
NO
----------------------------------------------------------------------------------------------------
B. Mischievous Mess Makers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
Output
10
Input
1 10
Output
0
----------------------------------------------------------------------------------------------------
C. Enduring Exodus
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
0100100
Output
2
Input
5 1
01010
Output
2
Input
3 2
000
Output
1
----------------------------------------------------------------------------------------------------
D. Robot Rapping Results Report
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5
2 1
1 3
2 3
4 2
4 3
Output
4
Input
3 2
1 2
3 2
Output
-1
----------------------------------------------------------------------------------------------------
E. Intellectual Inquiry
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 3
ac
Output
8
Input
0 2
aaba
Output
10
----------------------------------------------------------------------------------------------------
F. Cowslip Collections
time limit per test: 8 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 3 2
4
6
9
8
6
Output
5
16
Input
4 1 2
6
5
4
3
2
1
Output
20
21
----------------------------------------------------------------------------------------------------
G. Armistice Area Apportionment
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 5
1 0
2 1
Output
7.2111025509
Input
3 6
0 1
2 5
0 -3
Output
0.0000000000
----------------------------------------------------------------------------------------------------
