IndiaHacks 2nd Elimination 2017 (unofficial, unrated mirror, ICPC rules)


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

Examples
Input
3 5
00100
10110
11001
Output
5
----------------------------------------------------------------------------------------------------
B. Diverging Directions
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 9
1 3 1
3 2 2
1 4 3
3 5 4
5 1 5
3 1 6
2 1 7
4 1 8
2 1 1
2 1 3
2 3 5
2 5 2
1 1 100
2 1 3
1 8 30
2 4 2
2 2 4
Output
0
1
4
8
100
132
10
----------------------------------------------------------------------------------------------------
C. Future Failure
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2 100000007
Output
14
----------------------------------------------------------------------------------------------------
D. Airplane Arrangements
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
Output
128
----------------------------------------------------------------------------------------------------
E. Convex Countour
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
3.4142135624
----------------------------------------------------------------------------------------------------
F. Expected Earnings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 200000
250000 250000 250000 250000
Output
0.9000000000
----------------------------------------------------------------------------------------------------
