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


A. 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
----------------------------------------------------------------------------------------------------
B. "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
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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
----------------------------------------------------------------------------------------------------
E. Walking!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
RRLRL
Output
1
2 5 1 3 4
Input
RLRLRLRLR
Output
0
1 2 3 4 5 6 7 8 9
Input
RRRRRLLLL
Output
4
4 9 3 8 2 7 1 6 5
----------------------------------------------------------------------------------------------------
F. Mirror Box
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 1000000007
*/
/*
Output
1
Input
2 2 1000000007
**
\\
Output
1
Input
2 2 3
**
**
Output
2
----------------------------------------------------------------------------------------------------
