Program | TRIAN.C, TRIAN.CPP, TRIAN.PAS |
Given a triangle structure with white and black fields inside you must find the largest area of white fields, as shown in the following figure.
The input file contains several triangle descriptions. The first line of each
description contains an integer n (1 <= n <= 100), which gives the height
of the triangle. The next n lines contain characters of the set {space, #, -}
representing the rows of triangle, where # ia a black and - a white field. Tha
spaces are used only to keep the triangle shape in the input by padding at the
left end of the lines. (Compare with the sample input. The first test case correspond
to the figure.)
For each triangle, the numberof the characters # and - per line is odd and decreases
from 2n - 1 downto 1.
The input is terminated by a description starting with n = 0.
For each triangle in the input, first output the number of the triangle, as
shown in the sample output. Then print the line "The larges area is a.",
where a is the number of fileds inside the larges triangle that consists only
of white fields. Note that the largest triangle can have its point at the top,
as in the second case of the sample input.
Output a blank line after each test case.
Sample input:
5 #-##----# -----#- ---#- -#- - 4 #-#-#-- #---# ##- -Sample output
Triangle #1
The largest triangle area is 9.
Triangle #2
The largest triangle area is 4.