Codeforces Round 320 (Div. 2) [Bayan Thanks-Round]


A. Raising Bacteria
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
Output
2
Input
8
Output
1
----------------------------------------------------------------------------------------------------
B. Finding Team Member
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
6
1 2
3 4 5
Output
2 1 4 3
Input
3
487060
3831 161856
845957 794650 976977
83847 50566 691206 498447
698377 156232 59015 382455 626960
Output
6 5 4 3 2 1
----------------------------------------------------------------------------------------------------
C. A Problem about Polyline
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
Output
1.000000000000
Input
1 3
Output
-1
Input
4 1
Output
1.250000000000
----------------------------------------------------------------------------------------------------
D. "Or" Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 2
1 1 1
Output
3
Input
4 2 3
1 2 4 8
Output
79
----------------------------------------------------------------------------------------------------
E. Weakness and Poorness
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
1.000000000000000
Input
4
1 2 3 4
Output
2.000000000000000
Input
10
1 10 2 9 3 8 4 7 5 6
Output
4.500000000000000
----------------------------------------------------------------------------------------------------
F. LCS Again
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
aaa
Output
6
Input
3 3
aab
Output
11
Input
1 2
a
Output
1
Input
10 9
abacadefgh
Output
789
----------------------------------------------------------------------------------------------------
