Time Limit: Java: 2000 ms / Others: 2000 ms
Memory Limit: Java: 65536 KB / Others: 65536 KB
As you know, in one month it is Christmas and this year you are honored to make the big star that will be stuck on the top of the Christmas tree. But when you get the triangle-patterned silver paper you realize that there are many holes in it. Your little sister has already cut out smaller triangles for the normal Christmas stars. Your only chance is to find an algorithm that tells you for each piece of silver paper the size of the largest remaining triangle.
Given a triangle structure with white and black fields inside you must find the largest triangle area of white fields, as shown in the following figure.
The input is terminated by a description starting with n = 0.
Output a blank line after each test case.
Triangle #1 The largest triangle area is 9. Triangle #2 The largest triangle area is 4.