Company: Goldman Sachs_22july
Difficulty: medium
Lookout Triangle Problem Description During recess in a school garden, a group of children play a game called Lookout Triangle. Ropes have been laid flat on the ground. Each rope is a straight segment joining two points with integer coordinates, and ropes are allowed to cross one another or to lie along one another. A child may stand only at a rope endpoint, or at a point where two ropes cross. Two children can see each other when the straight segment joining them is completely covered by rope. That means both of the following hold: they lie on one straight line, and every part of that line between them lies on rope, with no gap. Several ropes that lie on the same straight line and touch each other form one continuous line of sight, because moving along them never changes direction. A stretch with no rope on it breaks the line of sight. A child standing exactly between two others on that same line blocks their view of each other. Three children form a Lookout Triangle when they stand a