Codeforces Round 689 (Div. 2, based on Zed Code Competition)


A. String Generation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3 2
4 1
Output
aab
acba
----------------------------------------------------------------------------------------------------
B. Find the Spruce
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 3
.*.
***
2 3
.*.
**.
4 5
.***.
*****
*****
*.*.*
5 7
..*.*..
.*****.
*******
.*****.
..*.*..
Output
5
3
23
34
----------------------------------------------------------------------------------------------------
C. Random Events
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4 3
4 3 2 1
1 0.3
3 1
4 0.6
5 3
4 2 1 3 5
3 0.8
4 0.6
5 0.3
6 5
1 3 2 4 5 6
4 0.9
5 0.3
2 0.4
6 0.7
3 0.5
4 2
1 2 3 4
2 0.5
4 0.1
Output
0.600000
0.720000
0.989500
1.000000
----------------------------------------------------------------------------------------------------
D. Divide and Summarize
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5 5
1 2 3 4 5
1
8
9
12
6
5 5
3 1 3 1 3
1
2
3
9
11
Output
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
----------------------------------------------------------------------------------------------------
E. Water Level
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 1 10 2 6 4
Output
No
Input
8 1 10 2 6 5
Output
Yes
Input
9 1 10 9 2 9
Output
No
Input
20 15 25 3 5 7
Output
Yes
----------------------------------------------------------------------------------------------------
F. Mathematical Expression
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 2 0
+-*
Output
2*2-0
Input
4
2 1 1 2
+*
Output
2+1+1+2
----------------------------------------------------------------------------------------------------
