Модуль: Number systems


Задача

18/18

Letter code - 2

Задача

Matroskin takes milk, curdled milk and cottage cheese to the market every three weeks. Every day he fills three cans in succession: first with milk, then with curdled milk, and finally with cottage cheese. Externally, the cans are exactly the same. Matroskin signed them as follows: first, the number of the day (from 1 to 21), then the capital letter M, P or T in accordance with the contents of the can.

Uncle Fyodor noticed that it is possible to sign cans using only letters, using a code of the same minimum length, sufficient to encode all cans for a specified period. At the same time, the code for each can will be assigned in such a way that if the new designations are sorted alphabetically, then the sequence of cans must be saved, both by day and during each day (milk, curdled milk, cottage cheese).

Determine which code will be assigned according to Uncle Fyodor's system to the can, which has the designation 20M according to the Matroskin system.

Write the resulting code in your answer.

Выберите правильный ответ, либо введите его в поле ввода

Комментарий учителя