The Dutch Farmer (tulips2)

71 teams scored 7100 points on this task, for a maximum score of 100, an average score of 100 and a median score of 100.

Highlights

  1. I.S. Castelli, Brescia is the institute with the most points (400).
  2. Lombardia is the region with the most points (1700).

Statement

A field of tulips is represented as an axis-aligned rectangle, with irrigation sprinklers placed on its four sides. These sprinklers spray a fertilizing solution over the field. The Dutch farmer, Jakob, wants to determine how many tulips will ripen faster because they are planted in a special fertilized zone. There are N tulips planted at locations (X_i, Y_i) for i=0… N-1. A tulip is considered to be in the fertilized zone if, together with the four corners of the rectangle, it forms (1) two acute-angled triangles, and (2) two obtuse-angled triangles. Your task is to count how many tulips meet this condition.