Farmer John purchased satellite photos of W x H pixels of his farm (1 <= W <= 80, 1 <= H <= 1000) and wishes to determine the largest 'contiguous' (connected) pasture. Pastures are contiguous when any pair of pixels in a pasture can be connected by traversing adjacent vertical or horizontal pixels that are part of the pasture. (It is easy to create pastures with very strange shapes, even circles that surround other circles.)
Satellite Photographs 农场主约翰给他的农场买了W x H像素的卫星照片(1 <= W <= 80, 1 <= H <= 1000),希望找出最大的"连续的"(互相连接的)牧场。对于一个牧场的任何一对像素,其中一个像素如果能横向的或纵向的与属于这个牧场的另一个像素相连,这样的牧场称作是连续的。 (很容易创建形状稀奇古怪的牧场,甚至是围着其它圆圈的圆圈。)
Each photo has been digitally enhanced to show pasture area as an asterisk ('*') and non-pasture area as a period ('.'). Here is a 10 x 5 sample satellite photo:
每一张照片都数字化的抽象了,牧场区显示为"*",非牧场区显示为"."。下面是一个10 x 5的卫星照片样例:
..*.....**.**..*****
.*...*....
..****.***
..****.***
This photo shows three contiguous pastures of 4, 16, and 6 pixels. Help FJ find the largest contiguous pasture in each of his satellite photos.
这张照片显示了大小分别为4、16、6个像素的连续牧场区。帮助农场主约翰在他的每张卫星照片中找到最大的连续牧场。
Input
* Line 1:
Two space-separated integers: W and H
* 第1行: 两个由空格分开的整数,W 和 H。
* Lines 2..H+1: Each line contains
W "*" or "." characters representing one raster line of a satellite
photograph.
* 第2到H+1行: 每一行包含W个"*"或者".",代表卫星照片的横向行。
Output
* Line 1:
The size of the largest contiguous field in the satellite photo.
Sample Input
10
5
..*.....**
.**..*****
.*...*....
..****.***
..****.***
Sample Output
16