| UFPE Starters Final Try-Outs 2025 |
|---|
| Finished |
Peter Mount and Ryei are in a very close Scrabble match. In the game, they must form words and earn points according to the rules. However, the Scrabble played in the MaratonaCIn is a little different: in this version, only words from a specific predetermined set can be formed.
Ryei realized he wouldn't be able to beat Peter Mount, as he is a master of the game. So, he decided to change his strategy: before trying to play a word, he would test which ones were more promising, that is, those that could be transformed into other words within the allowed set. To do this, given a word, he needs to know how many words, that are in the set, he can create, using the given word as a prefix.
Since Ryei is focused on the game, he asked for your help to create a program to assist him in this task. Can you help him?
4 5aababcabcdaaaababcabcd
4 0 3 2 1
| Name |
|---|


