#P8706. [蓝桥杯 2020 省 AB1] 解码
[蓝桥杯 2020 省 AB1] 解码
Problem Description
Xiaoming has a very long string of English letters, which may contain both uppercase and lowercase letters.
In this string, many consecutive letters are repeated. Xiaoming came up with a way to write this string shorter: write several consecutive identical letters in the form of the letter + the number of times it appears. For example, for consecutive a's, i.e. aaaaa, Xiaoming can abbreviate it as a5 (it can also be abbreviated as a4a, aa3a, etc.).
For this example: HHHellllloo, Xiaoming can abbreviate it as H3el5o2. To make it easier to express, Xiaoming will not abbreviate any run of more than 9 identical characters.
Now you are given the abbreviated string. Please help Xiaoming restore the original string.
Input Format
Input one line containing a string.
Output Format
Output one string, representing the restored original string.
H3el5o2
HHHellllloo
Hint
For all testdata, the string consists of uppercase and lowercase English letters and digits, and its length does not exceed . Note that the length of the original string may exceed .
Lanqiao Cup 2020 First Round Provincial Contest, Group A Problem F (Group B Problem G).
Translated by ChatGPT 5