Small Keyboard (keyboard)

11 teams scored 610 points on this task, for a maximum score of 100, an average score of 55 and a median score of 30.

Highlights

  1. G.B. Pininfarina, Moncalieri is the institute with the most points (100).
  2. Emilia-Romagna is the region with the most points (230).

Statement

Filippo loves keyboards, and he just bought a new one for his collection. Filippo's new keyboard is made of 10 keys arranged in a row, each containing a digit from 0 to 9. Initially the digits are arranged in ascending order, i.e. the first key contains 0, the second key contains 1, and so on. To test the new keyboard, Filippo decided to type a string S. Unfortunately, he is not very good at typing, in fact he only uses a single finger to press the keys. His finger can only move left or right, one key at a time, and he can only press a key if his finger is on it. In the beginning, his finger is on the first key, i.e. the key containing 0. Filippo can also swap the digits on two keys at any time (even before he starts typing), but he can only do this operation once. He does not move his typing finger while performing this operation, and he can do it even if his finger is on one of the two keys. To get more practice, Filippo wants to type T different strings S_1, S_2, …, S_T...