### Problem Statement

Suppose you are standing at the highest point, called M0, of a mountainous landscape. As you look around, you wonder how many different points you could walk to starting from your lofty position without ever going uphill. The set of these points is called peak P0, and the entire landscape can be divided into peaks according to a similar definition. For i > 0, let Mi be the highest point of the landscape not contained in peaks P0 through Pi - 1, and let peak Pi be the set of points to which there is a path from Mi that never goes uphill (but may remain level) and never touches points already contained in P0 through Pi - 1. The number of peaks in the landscape is the smallest value of n for which all points of the landscape are contained in P0 through Pn - 1.

You have a topographical map of a rectangular landscape, and you are interested in the area of its peaks. Write a class TopographicalImage with a method calcPeakAreas that takes a String[] topoData containing the height of the landscape at each x and y position and returns a int[] with the areas of each peak. The ASCII value of character x of element y of topoData is the height of the landscape at point (x,y). You can walk from a point to each of its vertical, horizontal, and diagonal neighbors. The return value should have a number of elements equal to the number of peaks in the landscape, and element i should be the number of points in Pi. If there is a tie between multiple points for maximum height when choosing Mi, choose the point with the smallest y-coordinate. If there is still a tie between points with the same y-coordinate, choose the point with the smallest x-coordinate.

### Definition

 Class: TopographicalImage Method: calcPeakAreas Parameters: String[] Returns: int[] Method signature: int[] calcPeakAreas(String[] topoData) (be sure your method is public)

### Notes

-Point Mi is always contained in peak Pi, so the area of a peak is always at least 1.

### Constraints

-topoData will contain between 1 and 50 elements, inclusive.
-Each element of topoData will contain between 1 and 50 characters, inclusive.
-Each element of topoData will contain the same number of characters.
-Each element of topoData will contain only characters with ASCII value between 33 and 126, inclusive.

### Examples

0)

 ```{ "............", "....i..i....", "....i..i....", ".o..i..i..o.", ".o........o.", "..oooooooo..", "............" }```
`Returns: { 78,  3,  3 }`
1)

 ```{ "............", "....i..i....", "....i..i....", ".S..i..i..Y.", ".M........E.", "..ILEYSMIL..", "............" }```
`Returns: { 69,  3,  2,  5,  3,  1,  1 }`
2)

 ```{ "zzzzzzzzzzzzz", "z...........z", "z...c.b.c...z", "z....bab.b..z", "z...c.b.c...z", "z...........z", "zzzzzzzzzzzzz" }```
`Returns: { 81,  6,  2,  1,  1 }`
3)

 `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LLKJIHGGFEDDCCBBBAAAAAAAAAAA", "CDFGIJLMNOOOONNMMLLLLLKKJIHGFEEDCCCBBBAAAAAAAAAAAA", "CDEFGIJKLMMMMMLLKKKKKJJIIHGFEDDCCBBBBAAAAAAAAAAAAA", "CCDEFGHIJKKKKKJJJIIIIIHHGGFEDDCCBBBBAAAAAAAAAAAAAA", "BCCDEFGHHIIIIIHHHHHHHGGGFFEDDCCBBBAAAAAAAAAAAAAAAA", "BBCCDEEFFGGGGGGFFFFFFFFEEDDCCCBBBAAAAAAAAAAAAAAAAA", "BBBCCDDEEEEEEEEEEEEEEEEDDDCCBBBBAAAAAAAAAAAAAAAAAA", "ABBBCCCCDDDDDDDDDDDDDDDCCCCBBBBAAAAAAAAAAAAAAAAAAA", "AABBBBBCCCCCCCCCCCCCCCCCCBBBBBAAAAAAAAAAAAAAAAAAAA", "AAABBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAA", "AAAAAABBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAA" }```
`Returns: { 1918,  65,  483,  5,  5,  24 }`

#### Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=2932

#### Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=5856&pm=2932

the_one_smiley

#### Testers:

PabloGilberto , lbackstrom , brett1479

#### Problem categories:

Graph Theory, Recursion, Sorting