Codeforces Beta Round 32 (Div. 2, Codeforces format)


A. Reconnaissance
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 10
10 20 50 60 65
Output
6
Input
5 1
55 30 29 31 55
Output
6
----------------------------------------------------------------------------------------------------
B. Borze
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
.-.--
Output
012
Input
--.
Output
20
Input
-..-.--
Output
1012
----------------------------------------------------------------------------------------------------
C. Flea
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3 1000000
Output
6
Input
3 3 2
Output
4
----------------------------------------------------------------------------------------------------
D. Constellation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6 1
....*.
...***
....*.
..*...
.***..
Output
2 5
1 5
3 5
2 4
2 6
Input
5 6 2
....*.
...***
....*.
..*...
.***..
Output
-1
Input
7 7 2
...*...
.......
...*...
*.***.*
...*...
.......
...*...
Output
4 4
1 4
7 4
4 1
4 7
----------------------------------------------------------------------------------------------------
E. Hide-and-Seek
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
-1 3
1 3
0 2 0 4
0 0 0 1
Output
NO
Input
0 0
1 1
0 1 1 0
-100 -100 -101 -101
Output
NO
Input
0 0
1 1
0 1 1 0
-1 1 1 3
Output
YES
Input
0 0
10 0
100 100 101 101
1 0 3 0
Output
YES
----------------------------------------------------------------------------------------------------
