2000 LSU Computer Science High School Programming Contest
Novice Problem 2: String Compression (Judge Copy)

MAIN
  Home
  Schedule
  Rules
  Compile

PROBLEMS
  Novice
  Veteran
  All

  

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Novice Problem 2: String Compression (Judge Copy)

Consider the string AAAABCCCCCDDDD consisting of alphabetic characters only. This string is of length 14. Since the string consists of alphabetic characters only, duplicate characters can be removed and replaced with a duplication factor n. With this technique the string can be compressed and represented by 4AB5C4D. The compressed string is of length 7. Write a program which takes a string in compressed form and recreates the original uncompressed string.

Input

Input will be a series of lines with one string per line. There will be only uppercase letters and digits in the string. All digits are compression counts. There will never be two digits in a row. You stop reading lines when you read a line with only a # on it. No input line will be longer than 50 characters.

Output

You are to output one line for each line of input. The output should be the uncompressed version of the input line.

Sample Input

3A4B7D
2D7AC8FGD
2ABCDE
#

Sample Output

AAABBBBDDDDDDD
DDAAAAAAACFFFFFFFFGD
AABCDE

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 0

3A4B7D
2D7AC8FGD
2ABCDE
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 0

AAAABBBBBDDDDDDDD
DDDAAAAAAAACFFFFFFFFFGD
AAABCDE

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 1

2Z8N4QM
DGF8C5A7D
ABRACADABRA
9Y3M2P
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 1

ZZZNNNNNNNNNQQQQQM
DGFCCCCCCCCCAAAAAADDDDDDDD
ABRACADABRA
YYYYYYYYYYMMMMPPP

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 2

A
5H
2M4V9E
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 2

A
HHHHHH
MMMVVVVVEEEEEEEEEE

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 3

3ABCD4E2Z
9Q8W7E6R5T4YTREWQ4ASD3FG2HMN2B3VC4X5ZFG
5H5I
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 3

AAAABCDEEEEEZZZ
QQQQQQQQQQWWWWWWWWWEEEEEEEERRRRRRRTTTTTTYYYYYTREWQAAAAASDFFFFGHHHMNBBBVVVVCXXXXXZZZZZZFG
HHHHHHIIIIII

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.



The statements and opinions included in these pages are those of the LSU Computer Science High School Programming Contest Staff only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.

© 2000 LSU Computer Science High School Programming Contest

This page last updated Fri Feb 11 21:55:29 2000.