Wunder Fund Round 2016 (Div. 1 + Div. 2 combined)


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

Examples
Input
1
Output
1
Input
2
Output
2
Input
3
Output
2 1
Input
8
Output
4
----------------------------------------------------------------------------------------------------
B. Guess the Permutation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
0 1
1 0
Output
2 1
Input
5
0 2 2 1 2
2 0 4 1 3
2 4 0 1 3
1 1 1 0 1
2 3 3 1 0
Output
2 5 4 1 3
----------------------------------------------------------------------------------------------------
C. Constellation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
0 1
1 0
1 1
Output
1 2 3
Input
5
0 0
0 2
2 0
2 2
1 1
Output
1 3 5
----------------------------------------------------------------------------------------------------
D. Hamiltonian Spanning Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2 3
1 2
1 3
3 4
5 3
Output
9
Input
5 3 2
1 2
1 3
3 4
5 3
Output
8
----------------------------------------------------------------------------------------------------
E. Robot Arm
time limit per test: 8 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
1 1 3
2 3 90
2 5 48
1 4 1
Output
8.0000000000 0.0000000000
5.0000000000 -3.0000000000
4.2568551745 -2.6691306064
4.2568551745 -3.6691306064
----------------------------------------------------------------------------------------------------
F. Double Knapsack
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10
10 10 10 10 10 10 10 10 10 10
10 9 8 7 6 5 4 3 2 1
Output
1
2
3
5 8 10
Input
5
4 4 3 3 3
2 2 2 2 5
Output
2
2 3
2
3 5
----------------------------------------------------------------------------------------------------
G. Combining Slimes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 500000000
Output
3.562500000000000
Input
10 1
Output
64.999983360007620
Input
100 123456789
Output
269.825611298854770
----------------------------------------------------------------------------------------------------
