Drawing Slashes (slashes)

20 teams scored 867 points on this task, for a maximum score of 100, an average score of 43 and a median score of 11.

Highlights

  1. IS A. Scarpa, Motta Di Livenza is the institute with the most points (100).
  2. Emilia-Romagna is the region with the most points (233).

Statement

Tommaso is a special kid: his favorite hobby is to draw lines in the diagonals of a sheet of squared paper. The rule he is following is: for every square, he will either draw the main diagonal (going from the top-left to the bottom-right) or the secondary diagonal (going from the top-right to the bottom-left). This is how his drawings look like: After drawing all the lines, Tommaso also wants to color the areas that are formed. Each area is delimited either by lines or by the border of the sheet. For simplicity, the input will be provided to your program using slashes and back-slashes. The above drawing would be represented on a 3 × 5 grid like this: To make the drawing more interesting, he would like to draw each area of a different color: how many colors does he need to use?