Largest Rectangle (rectangle)

408 teams scored 32785 points on this task, for a maximum score of 100, an average score of 80 and a median score of 100.

Highlights

  1. Banfi, Vimercate is the institute with the most points (955).
  2. Lombardia is the region with the most points (6465).

Statement

Alice has N wooden sticks. Their lengths are S_0, S_1, …, S_N-1, and all of them are positive integer numbers. Alice wants to choose four sticks so that she can create a rectangle with the sticks as sides of the rectangle (see the image below). Each stick has to correspond to one side, she cannot cut the sticks or combine two or more into one. The sticks have to be exactly as long as the side of the rectangle, they cannot be longer or shorter. Moreover, Alice wants to create the rectangle with the largest possible area. Can you help her and tell the maximum possible area of the rectangle that she can create from her sticks? It might not be possible to create a rectangle from the sticks: in this case your program should print 0.