Plowing Fields (tractor)

15 teams scored 708 points on this task, for a maximum score of 68, an average score of 47 and a median score of 50.

Highlights

  1. Galileo Ferraris, Molfetta is the institute with the most points (84).
  2. Emilia-Romagna is the region with the most points (259).

Statement

Marco is tired of preparing the OIS rounds, so he decided to quit his job and become a farmer. As a farmer, he now has to plow his field. The field is divided into N rows, and to plow the field Marco has to plow each row one at a time. Every row must be plowed exactly once. Marco starts from row 0 on one side of the field, he plows the row to the other side, then turns the tractor and repeats in another row. If the tractor is in row x, when it turns it can go to row y with cost abs (x - y). However, the tractor is very large hence needs space to turn around. Then, it can only go from row x to row y iff abs (x - y) > K. Help Marco find a way to plow the field minimizing the total cost.