Tuscan Peaks (peaks)

331 teams scored 20872 points on this task, for a maximum score of 100, an average score of 63 and a median score of 59.

Highlights

  1. ITI Planck, Villorba is the institute with the most points (642).
  2. Lombardia is the region with the most points (4170).

Statement

The mountains around Pisa are a well known hiking destination, with a peculiar terrain shape. In particular, you are interested in a rectangular area of N × M square meters, subdivided into N × M square cells, each with an area of a square meter. Those cells are uniquely identified by their distance from the top and the left sides of the rectangle, with cell (i,j) being at a distance of i meters from the top of the map and j meters from the left side of the rectangle. Each cell (i, j) has an altitude of H_i,j meters, described by two arrays of integers A and B: H_i,j = A_i* B_j. A peak is a cell that has a strictly higher altitude than all the cells that share a side with it. How many peaks are there?