Graduation Card (text)

29 teams scored 2830 points on this task, for a maximum score of 100, an average score of 98 and a median score of 100.

Highlights

  1. Liceo Scientifico N. Copernico, Udine is the institute with the most points (200).
  2. Lombardia is the region with the most points (400).

Statement

Luca has been invited to Edoardo's graduation party, where he knows there will be a lot of confetti! He bought a graduation card and now he needs to write a little congratulatory message on it. The message he wants to write is N words long, where the i-th word is W_i. Luca knows that he always makes mistakes when writing on little cards. In particular he always overestimates the space he can use to write the message, so he ends up writing the last words much smaller than the first ones. To prevent this, he has decided that each line must contain at most K letters or spaces. He wants to lay out the message so that the first word is at the beginning of the first line, followed by all the other words. When a word doesn't fit in a line, that word is put on a new one, followed by the other words, and so on. Can you help Luca lay out the message?