cf/mirror

New Year and Snowy Grid

CF
750H3500· legendary gm9s256 MB⇄ interactive

Examples

Sample 1of 2
Input
3 5 4
.....
.....
.#...
1
1 4
1
1 5
2
2 4
3 1
2
1 5
3 3
Output
NO
YES
YES
NO
Sample 2of 2
Input
9 31 5
...............................
...............................
.###.###.#.###...###.###.#.###.
...#.#.#.#.#.......#.#.#.#...#.
.###.#.#.#.###...###.#.#.#...#.
.#...#.#.#.#.#...#...#.#.#...#.
.###.###.#.###...###.###.#...#.
...............................
...............................
5
6 5
2 11
1 14
8 15
2 14
5
2 14
1 14
8 16
6 5
2 11
3
2 2
1 4
8 30
10
3 1
3 11
5 16
7 21
4 16
3 5
7 31
3 9
7 25
3 27
10
3 1
3 9
7 25
3 27
7 21
4 17
3 5
7 31
4 16
3 11
Output
NO
YES
YES
YES
NO
750H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…