#P16469. [GKS 2013 #A] Read Phone Number
[GKS 2013 #A] Read Phone Number
题目描述
Do you know how to read the phone numbers in English? Now let me tell you.
For example, In China, the phone numbers are digits, like: . Someone divides the numbers into -- format, i.e. . While someone divides the numbers into -- format, i.e. . Different formats lead to different ways to read these numbers:
reads one five zero one double two three three triple four.
reads one five zero one double two double three triple four.
Here comes the problem:
Given a list of phone numbers and the dividing formats, output the right ways to read these numbers.
Rules:
Single numbers just read them separately.
successive numbers use double.
successive numbers use triple.
successive numbers use quadruple.
successive numbers use quintuple.
successive numbers use sextuple.
successive numbers use septuple.
successive numbers use octuple.
successive numbers use nonuple.
successive numbers use decuple.
More than successive numbers read them all separately.
输入格式
The first line of the input gives the number of test cases, . lines|test cases follow. Each line contains a phone number and the dividing format , one or more positive integers separated by dashes (-), without leading zeros and whose sum always equals the number of digits in the phone number.
输出格式
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the reading sentence in English whose words are separated by a space.
3
15012233444 3-4-4
15012233444 3-3-5
12223 2-3
Case #1: one five zero one double two three three triple four
Case #2: one five zero one double two double three triple four
Case #3: one two double two three
提示
Limits
.
Test set 1 - Visible
.
Test set 2 - Hidden
.