TUTBFS  Tutorial BFS
Given a grid made of '.' and '#', you begin at (0, 0) the top left corner. It is guaranteed that (0, 0) will be a '.' The grid is n x m, with 4 <= n, m <= 100. You can move up/down/left/right/all_diagonals, with a move cost of 1. What is the furthest distance that you can reach from (0, 0) ?
Input
Given T, the number of test cases. Following this are T data sets, with the first line stating N and M. Following this are N strings consisting of '.' and '#', each containing M characters.
Output
T lines containing the maximum distance from the starting location (0, 0) in each test case.
Example
Input: 2 4 4 .#.# .#.. .##. .... 3 9 .#...#... .#.#.#.#. ...#...#. Output: 7 10
hide comments
olympian_:
20160315 11:03:30
I dont get the fact that I get correct answer for these test cases on my terminal but get SIGSEV fault on SPOJ, any idea why?


siddiboy:
20160309 20:29:04
can someone plz give me another test case... I can't figure out where m going wrong 

Matthew Bregg:
20150220 01:22:49
You need to find the furthest shortest distance to a point. 

Stupid Dog:
20150218 09:04:08
I need explain the example test 
Added by:  Alex Anderson 
Date:  20130212 
Time limit:  0.259s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Life 