Wine Tasting Tour (wine)

29 teams scored 1530 points on this task, for a maximum score of 100, an average score of 53 and a median score of 50.

Highlights

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

Statement

Giorgio loves wine and decided to treat himself and go on a wine tasting tour! The winery offers several tours of its N vineyards, arranged in a row. Giorgio can start the tour from any vineyard S. Then, once the first tasting is over, he will move on to the vineyard S+1, then to the vineyard S+2 and so on until reaching the vineyard E that ends the visit. Note that Giorgio is also free to choose to start and end his tour on the same vineyard. The tasting in the i-th vineyard costs Giorgio V_i euro; therefore the overall cost of the tour is simply the sum of the costs of the visited vineyards. Giorgio is struggling to choose among the (N(N + 1))/2 possible different tours, and thus decided to defer the decision to a simple algorithm. He is going to list all the tours (S, E) and sort them in increasing order of cost. In case of ties, the tours with the smallest starting vineyard come first. Then, he is going to choose the K-th one (counting from 1) from this sorted list...