Codeforces Round 272 (Div. 2)


A. Dreamoon and Stairs
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 2
Output
6
Input
3 5
Output
-1
----------------------------------------------------------------------------------------------------
B. Dreamoon and WiFi
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
++-+-
+-+-+
Output
1.000000000000
Input
+-+-
+-??
Output
0.500000000000
Input
+++
??-
Output
0.000000000000
----------------------------------------------------------------------------------------------------
C. Dreamoon and Sums
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
0
Input
2 2
Output
8
----------------------------------------------------------------------------------------------------
D. Dreamoon and Sets
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
5
1 2 3 5
Input
2 2
Output
22
2 4 6 22
14 18 10 16
----------------------------------------------------------------------------------------------------
E. Dreamoon and Strings
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aaaaa
aa
Output
2 2 1 1 0 0
Input
axbaxxb
ab
Output
0 1 1 2 1 1 0 0
----------------------------------------------------------------------------------------------------
