• 沒有找到結果。

Run-length encoding is a very simple and easy form of data compression in which consecutive occurrences of the same characters are replaced by a single character followed by its frequency

N/A
N/A
Protected

Academic year: 2021

Share "Run-length encoding is a very simple and easy form of data compression in which consecutive occurrences of the same characters are replaced by a single character followed by its frequency"

Copied!
1
0
0

加載中.... (立即查看全文)

全文

(1)

11541 Decoding

Encoding is the process of transforming information from one format into another. There exist several different types of encoding scheme. In this problem we will talk about a very simple encoding technique;

Run-Length Encoding.

Run-length encoding is a very simple and easy form of data compression in which consecutive occurrences of the same characters are replaced by a single character followed by its frequency. As an example, the string ‘AABBBBDAA’ would be encoded to ‘A2B4D1A2’, quotes for clarity.

In this problem, we are interested in decoding strings that were encoded using the above procedure.

Input

The first line of input is an integer T (T < 50) that indicates the number of test cases. Each case is a line consisting of an encoded string. The string will contain only digits [0-9] and letters [A-Z]. Every inputted string will be valid. That is, every letter will be followed by 1 or more digits.

Output

For each case, output the case number followed by the decoded string. Adhere to the sample for exact format.

You may assume the decoded string wont have a length greater than 200 and it will only consist of upper case alphabets.

Sample Input

3

A2B4D1A2 A12 A1B1C1D1

Sample Output

Case 1: AABBBBDAA Case 2: AAAAAAAAAAAA Case 3: ABCD

參考文獻

相關文件

Figure 3: Comparison of the partitioning of the hemisphere effected by a VQPCA-based model (left) and a PPCA mixture model (right). The illustrated boundaries delineate regions of

Consequently, these data are not directly useful in understanding the effects of disk age on failure rates (the exception being the first three data points, which are dominated by

In taking up the study of disease, you leave the exact and certain for the inexact and doubtful and enter a realm in which to a great extent the certainties are replaced

In the algorithm, the cell averages in the resulting slightly non-uniform grid is updated by employing a finite volume method based on a wave- propagation formulation, which is very

Students are asked to collect information (including materials from books, pamphlet from Environmental Protection Department...etc.) of the possible effects of pollution on our

A subgroup N which is open in the norm topology by Theorem 3.1.3 is a group of norms N L/K L ∗ of a finite abelian extension L/K.. Then N is open in the norm topology if and only if

(a) The magnitude of the gravitational force exerted by the planet on an object of mass m at its surface is given by F = GmM / R 2 , where M is the mass of the planet and R is

Humanistic Buddhism is, no doubt, a very important stage in the development of Chinese Buddhism, and is exemplified by Venerable Master Hsing Yun’s thoughts and deeds, particularly