Codeforces Round 487 (Div. 2)


A. A Blend of Springtime
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
.BAC.
Output
Yes
Input
AA..CB
Output
No
----------------------------------------------------------------------------------------------------
B. A Tide of Riverscape
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 7
1.0.1.0.1.
Output
1000100010
Input
10 6
1.0.1.1000
Output
1001101000
Input
10 9
1........1
Output
No
----------------------------------------------------------------------------------------------------
C. A Mist of Florescence
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3 2 1
Output
4 7
DDDDDDD
DABACAD
DBABACD
DDDDDDD
Input
50 50 1 1
Output
4 50
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
ABABABABABABABABABABABABABABABABABABABABABABABABAB
BABABABABABABABABABABABABABABABABABABABABABABABABA
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
Input
1 6 4 5
Output
7 7
DDDDDDD
DDDBDBD
DDCDCDD
DBDADBD
DDCDCDD
DBDBDDD
DDDDDDD
----------------------------------------------------------------------------------------------------
D. A Shade of Moonlight
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 1 2
-2 1
2 1
3 -1
5 -1
7 -1
Output
4
Input
4 10 1
-20 1
-10 -1
0 1
10 -1
Output
1
----------------------------------------------------------------------------------------------------
E. A Trance of Nightfall
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
0 0
1 3
2 2
3 1
4 4
10
1 1
2 1
3 1
4 1
5 1
3 2
3 3
3 4
3 5
3 6
Output
0.50000000000000000000
0.50000000000000000000
0.33333333333333331483
0.50000000000000000000
0.50000000000000000000
0.18518518518518517491
0.15226337448559670862
0.14494741655235482414
0.14332164812274550414
0.14296036624949901017
----------------------------------------------------------------------------------------------------
