Test Case for Question #1 in DWITE 2011-2012 High School Round 4
Contest: DWITE 2011-2012 High School Round 4
Question: #1
Input File: DATA1.txt
Output File: OUT1.txt
Input
15 16
#.#.#.#.###.#.#.
.........#......
#.#.#.#.#.#.#.#.
........#.......
#.#.#.#.#.#.#.#.
##....#.........
#.###.#.###.#.#.
.......#........
#.#.###.#.###.#.
........#....##.
#.#.#.#.#.#.#.#.
......#.........
#.#.#.#.#.#.#.#.
.....#..........
#.#.###.#.#.#.#.
16 15
....#....#.....
....#....#.....
...............
.....#....##...
###...##....###
....#..........
...#....#......
.....#...#.....
......#....#...
..........#....
###....##...###
...##....#.....
...............
.....#....#....
.....#....#....
#.#.###.#.#.#.#
99 9
.........
.#.....#.
.#.....#.
.#.....#.
.#######.
.#.....#.
.#.....#.
.#.....#.
.........
.#######.
....#....
....#....
....#....
....#....
....#....
.#######.
.........
.........
.........
.........
.........
.........
.#####...
.#....#..
.#.....#.
.#.....#.
.#.....#.
.#....#..
.#####...
.........
.#.....#.
.##...##.
.#.#.#.#.
.#..#..#.
.#.....#.
.#.....#.
.#.....#.
.........
...#####.
..#......
.#.......
.#.......
.#.......
..#......
...#####.
.........
.#######.
....#....
....#....
....#....
....#....
....#....
.#######.
.........
.........
.........
.........
.........
.........
.#.......
.#.......
.#.......
.#.......
.#.......
.#.......
.#######.
.........
...###...
..#...#..
.#.....#.
.#.....#.
.#.....#.
..#...#..
...###...
.........
.#.......
.#.......
.#.......
.#.......
.#.......
.#.......
.#######.
.........
...###...
..#...#..
.#.....#.
.#.....#.
.#.....#.
..#...#..
...###...
.........
.#.......
.#.......
.#.......
.#.......
.#.......
.#.......
.#######.
.........
61 96
#.##..#.......#........#......#..#...#......#.#..#...#...#..##...#...#.#........................
.....#.............####.................#.....#.#..#....#..##.......#..................#........
.....#.#........##...##...............................#.....#.....#.#.............#..#.#........
.##..#..#........###............##......##...........................#..#......................#
.......#......#....#............#...................#.#...................#.......#...#......#..
.#.......#.....#...........#..........#...................#..#..................................
#..#...##.....#..#.......#........................#......#..........#..##..#.#....#.#.........#.
#.....#......#..#......#.................#.#.....#................#.......#.........#...........
.............#.#.........................#..#........#.......#....#......#.....#.#..##..........
..#................#.......#.#.#.......................#.#.....#...#.....#............#.........
.........#..#.....#..#.#..#.#..#.#..##.#....#..#..#..#..................................#...#...
............#........#.......##...#.........#..#.........#.#......#.......#......#..............
.#..................#............#...........#....................#...........#...........#....#
..............#.#.#.#....#.#...........#.......................#...#............#.......#.....##
#...........................#....................#.......##...#...........#..#..#.#....#........
......#...............#...#.#..#...........#......#.#......##....#.........#...........#........
...............#..#.............##.......#........#....#........#.....#..........#.......#......
#...##.##...............#.......#..#.....#..#.......#.......#..#..#.#........#...#.#.....#......
.........#......#..#...#.............#.......#..#..........................#.............#......
............#..#.....#..................#........#.#.......#...............##...#....#..........
........#........#.#.##..........#..................#.#...........................#............#
..........................#..#...#.......#.#.........#....#...#.........#...##.......#....#....#
.........................#..#...................#.....#...#.......##.#.#................#.#.....
.............#....#.....#.#...#.........#.#.............................#.......#.....#.#.......
#...###.#.#.....#............................#.........#..................#.#...............#...
#.......................................#................................#............##........
.......#......#..................................#..#.....#........#........#...#.....#........#
...#....#.....#....#..##.........................#...##..##......##......#...#......#...........
..#.#........................................#.#.................#..................#.#......#..
..........#...#...#....#.#............#.............#..#...#..#.#...........#........##.........
....#.#..........#...............#..#...........#.#.#..............###..................#.#.##..
#...............##....###..##..#...............#...#.......#..........##.............##.##......
...................#........................##..#....#..............#....#....#.......#..##.....
..........#...#.#......#......#...#...............#..#..........#...#.........#............#....
.#..............#................#....#.....#................###.........#............#...##....
....#........##.........................#..#...#......................................#.........
...#...........#...#.........#.#........#..........##.##......#..............#...............#..
....##.....#.#..............#..#..........#......#..#.......#.........................#...#...#.
.#...#...###.....##.#......#.......#........#....##..........#..#.#.......#...........#....#....
.#.#.#..#.....#......................................#...........#.......#.......#........#.#...
.....#......#.....###........#...#.......#.....##....##..#....#..#..##.#..............#.........
.........#.#..##.....#..#...#..............##....#.........#..#..........#............#...#.....
..#......................................#....#.....................#...........................
..#..............#...#..............#....#........................##..#.................##......
......#.....#............#.....#..#..#..........#..#.....#...#.#...............#...........#....
.....#.#......#...##......#....................#.....#..#.......................................
..#...............#.......##...........#.#..................#...#.....#.........................
.#......#.............#.....#..#.#........#........................#.....................#......
.........................#.#......#..#...#............#..#........................#.............
...#..#........#...........#...............#..............#..#.................#..#.......#..#..
........#..####.#.........#.....#..#....#.#........#...................#......................#.
...#.#...............##...#.#.......#.........#......#....#..................#.#.........#......
....#........###........#.....................#...#.#............#.....#....#.......##..........
.....................##..............#.........##..........#.....#...................#..###.....
....#..#....#......................#......#....................................#................
.............................#...........................#..................#......#............
.#...#...........................#......................#..#........................#...........
.....#..#........#..#.#......#............#...............#.....#..#.....#...#..................
.....#..#................##........#....#..#.##..............#..#........#.......#..............
....#...........##....#.....#.................#................#............#..#.......#..#.#..#
..............#.#......#........#................#......#...##.#..#........................#....
98 93
..#...#................................#...##..#................#..#...#....#.....#..#......#
.............#.#...#.#............##...........#..##...................#..#............#.....
.#.......#.....#...#...#............#.................#.....##...................#...........
.......#........#..#..#..............#......#..#.....#...................##..................
..#...............#...............#.#.....#...#............#...........................#.....
..........#............#...#........#.#....#..........#.......#............................#.
.........#........................#.................#..................#..#..................
......##..........##.........................#...............#........#...........#...#......
...........#.........#....#..#.......#.#.#.....#...##.#....#..#......##......#..#.......#....
....................#..#.......#.#.................#..#.#...#...#..#.....#...#........#.#....
..#...........#..............#...........#...#..........#..............#............#.#......
...............#.......#..#.........#........#......##...##......#.....#.....................
......#.#............#.#....................................#................................
......#..............#.....#......#.......#..#.#............##..#.#...#.............#........
...................#............................#.#..#..#.#...#.......#................#....#
#..........#...#..............#.......#....#.............#.#......##......#.......#....##.#..
..##.....#.##.........#...##......#.#..........................#...........#...........#...##
............#..#.#....#.......#..#....#...................................#..###..........#..
.#......#....#.#...##....................#.#....#..................#.#.........#..#.....#....
...........#..............#............##.......................#........#.#...........###...
.......................#.##..........#..#...................................#.#..........#...
.#..#....#..#.....#...#..#...#..#...................#...............#....#......#.#...#.....#
.......##..........................#........#.#.....#..##..#......#.#...#...........#..#...#.
..........................#........#....#....#.................##.....#..........##....#.....
................................#..#..#.........................#.....#........#.##.#....#.#.
.#..#..#....#.............#...#....#.............#...##...............#.......#...##..#......
..#..#....#...#.....#.......#.#.............#.............#...#..........##..#.#.##..........
.......#.#..#...#..#.......#..#...........#....#.#......................#........#...........
##.#....#...####.#.#...........##..#...............................#.........#..#....####....
.........#..........##......#........#...........##...#....#...........#............#........
.....##...........#..#.......#...............#..#.#.................#.........#...........#.#
......#.................#.........#.................................#..###.....#.....#....#..
.#...#..............#...#.#......#...#......##......#.................#...#...............#..
..........#...#...........................#...#.#...........##.....#.....#...#.....##........
.........#...#.....................#...........#...#...........#........###.#..##.#..........
.......#....#..................#.#.#.....#..........#.#.....................................#
............#..........#..#.......#..............##..#.......#.........#...#.................
#......#....#.#..........................#.....##.....#....#.....#..............#..#...#.....
....##....#.......#.........#...#......#.............##...........#..........................
..............##........................##...........#...............#...#..........#........
....#.#..##...##.....#.##..#.............#......#..................##..#.....................
#........##....#.....#......#..........#....#.#........#.....#.#..................#...###..#.
.......#...#..#....#.......#..............#..............#.................##...#...#......#.
#....#...........#....##........#.##....#........#........##.........................#.......
..#.............#.#.........#.#...........#.........#.......###...#.#...#.............#......
.........................................#..#....#....................................#.#.#.#
.#....#..#........#..##........#.#....#....#..............................................#..
#...................................................#............................#.#.......#.
#...............#..#.....#.....#.#.........#...........................#.#.......##..#.#.#...
.................#......#.#......#..........#......#....................#.#.........##....#..
.#.....#.......#..........#..#.......................#....#...#...#....##......#.#...........
...........#..........#.#..#........#.....#.......#...............#.#.................#......
#............#.#................#..#.#.#..#....#.............#.........#...###.............##
.............##........#.......#..#..........#...........#...#....#...........#..#..........#
.#...............#............#......#.............#..#..#.......#.......##.......#..........
......#..#................#...#.....................#...#...#.#..#...#...#....#..#.#.........
.................#.........#...#..#.........#.#....#..#.................................#....
......#.#.............#...........#............#..........#.............#........#..........#
.#.......##......##.#................................#..#........#....##.....................
...#..............#............##...................#..#...##.#.#.........#...#.#.........#..
...##.#..##........................##.#.......#.......#....#..#.#........#.............#.....
.............#.##.....#.....#...#..........#.......#.#..#.#.......#..................#.......
............#....#..............##.....#........#..#........##...............#............#..
.....#.#..#....#...##...........................#.....#........................#..#..........
#................#......#....#.........##..............#................#......#..#..#.......
......#...............#.................#........#........#..........#.........#......#...#..
...#.#.....................#.....#....#......#.#........#......#......#........##............
..#.....................#...............#.....................#............................#.
..............#....#.........##...##..#.......#..#.#..#.........#.............#.##...........
..#....#.........#........#.......#......#......##..#.......#..#.........#.......#..#........
..................#..........##..#....................#..#.#....#..#....#..#....#.........#..
...#...............#..#.##.................#.##......#....................#....#..........#..
.##.........#....#...#....#.....#............#....................#.##..........##...........
#.#......#..##..............#......##......#....#.#.#..#..........#.....#...#...........#.#..
....##..#.....#.....#..........................#.#......#.#.......#.................#...#....
.#..##..........#............#..#..#................##................#.........#..#..#.#.#..
............#........##.#..........#....................#..#..#.........#......#...#.....#..#
........#.#.........##.......#..........##..#...............#..#.......##...........#........
...........#....#.......#..............#........#.#...#........##..#.........................
.................#..#...............#..................#.....##.............#...#...#.#......
...#...#........##........#....#..........#.##...#..#.............##........#....#.......##..
........#.....#.#...............#...#..............#................#.......#...........#....
..#..#............#..##......................#.............##......#........#.#......#.....#.
.#......#...........#................#.......#.........#.#....#....#...#.....................
#........#....#.......##............#..#..#.....#....#.#..#..#............#....#.#......#....
..#....##...........#........##...................#.....................#.#.#............#...
.##.........................#..#......#.#.#.......#...........#.....#....#..#.......#..#.....
#.....#....#.#..........................##.......##.........#.#...................#......#...
...#......#..#.#..#.....#..............#....#...#.......................##......#......#.....
...#......##.###....#.#.#......#.#....##............#....#.........#.............#.........#.
.#..#..........#........#..#.#..#....#.#............#....##...........#.#....................
..#.#........#.......#....#...#......#..#......#..#.#..........#......#........#...........##
#..#.#.......##...#.#...#.....#..#.............................#...........#.#.....#.........
.............#...............#.........................#........................#.....#......
#.#...............#...#..#.....#..................#.........#.......#.......#...##...........
........#....#.#......#..#.......#..#..#....#.........#.......#..........#...........#....#..
...........#.#.....#.....#..#.....#.............#..#..#............#.......................#.
.............##.#..................##...................#......#.........#...........#....#..
Output
14 15
37 45
117 95
585 592
946 947