SP3490 HIDTRI - Hidden Triangle

Description

Assume that each `0' or `1' in the array represents a point on a plane and the distance between each pair of neighbouring points row wise or column wise is unity. Assume further that every neighbouring pair of 1's, row wise, column wise or diagonally is connected by a line segment. Two line segments emerging from a point, either join together to form a longer line segment or form an angle of 45 $ ^{o} $ , 90 $ ^{o} $ or 135 $ ^{o} $ , thus forming right-angled isosceles triangles. The existence of hidden right-angled isosceles triangles in an array is illustrated in the figure below. ![\epsfbox{p3258.eps}](http://acmicpc-live-archive.uva.es/nuevoportal/data/p3258.jpg)

Input Format

N/A

Output Format

N/A