House of cards (cards)

190 teams scored 12750 points on this task, for a maximum score of 100, an average score of 67 and a median score of 70.

Highlights

  1. Pietro Paleocapa, Bergamo is the institute with the most points (580).
  2. Lombardia is the region with the most points (2610).

Statement

Luca, Edoardo, William and Giorgio are playing at the famous card game briscola. While Edoardo was setting up the deck, he noticed that a card was missing. In fact, that same day he made a huge house of cards and he left the last card of his deck inside it! Now, he really wants to play with his friends without destroying his castle: help him find out how much of the castle must be torn down. An house of cards is made up of triangles of cards. If you remove a card that is under another, all the castle falls in pieces. You can easily remove a triangle from the top without risking a disaster, but you want to minimize the number of triangles removed to keep the structure beautiful. The card Edoardo wants is in the C-th triangle of the R-th row from the top of the castle, which has N rows total. Note that the i-th row (from 1 to N) has i triangles of cards. How many triangles of cards do you have to remove at least, in order to have the missing card in hand?