City Tour (minperm)

5 teams scored 500 points on this task, for a maximum score of 100, an average score of 100 and a median score of 100.

Highlights

  1. IS A. Scarpa, Motta Di Livenza is the institute with the most points (100).
  2. Veneto is the region with the most points (100).

Statement

The beautiful city of Julcvari decided to host a city tour (online, of course). They have N different attractions, the i-th one having a beauty equal to i. An initial order P for the presentation of the attractions has been selected, but the people of Julcvari are worried that it might not be the best one. The citizens believe that the best visit order is the one with minimum \phi-coefficient, which is equal to the number of pairs (i,j) such that i is more beautiful than j (i > j), but i comes before j in the ordering. Organizing events is not so easy: a lot of paperwork has to be done in order to change events of this calibre. The host managed to get approval for K swap lengths L_1, L_2,…, L_K. The host can perform any number of swaps on the initial order, such that the swapped attractions are at a distance (i.e. the difference between their positions in the ordering) equal to one of the elements from array L...