F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Digit Size

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 633    Accepted Submission(s): 205


Problem Description
Digital LC-display is widely used in many different fields such as electronic calculator, electronic watch, digital instruments, etc. A simulated example of the numbers represented by digital LC-display device is shown as follows:

Each number represented by LC-display above is composed of s "-" signs for the horizontal segments and s "|" signs for the vertical ones, and each number exactly occupies s+2 columns and 2s+3 rows. Your task is to change the size of the original numbers by changing "s" ¡ª the number of signs.
 

Input
The first line of input contains a number t, which means there are t cases of the test data.
The input contains several lines, 2s + 4 for each number to be displayed. The first line of each case contains two integer s and t (1 <= s, t <= 9), where s is the original size of the numbers and t is the target size of numbers that you should output. The following 2s + 3 lines show the original number n (the digit of n will not exceed 9) you should deal with. Each digit of n will be separated by an empty column (except for the last digit).
 

Output
For each test case, output the case number and then output the target number according to the input. Output a blank line after each case.
 

Sample Input
2 2 5 -- -- -- | | | | | | | | | | | | -- -- -- -- | | | | | | | | | | -- -- -- 2 1 -- -- -- -- -- | | | | | | | | | | | | | | | | -- -- -- | | | | | | | | | | | | | | | | -- -- -- --
 

Sample Output
Case 1: ----- ----- ----- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----- ----- ----- ----- | | | | | | | | | | | | | | | | | | | | | | | | | ----- ----- ----- Case 2: - - - - - | | | | | | | | - - - | | | | | | | | - - - -
 

Author
Totoro (Special Thanks mach)
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-03 21:28:22, Gzip enabled