#PCBTAM0000027. Lặp khối trong ngoặc (Repeat Bracketed Block)
Lặp khối trong ngoặc (Repeat Bracketed Block)
Repeat Bracketed Block
Version: Phuoc Hung OJ Extended
Problem Statement
Given a string and a nonnegative integer , first construct a block consisting of an opening square bracket [, all of , and a closing square bracket ]. Then print consecutive copies of the entire block, with no separators.
Even if is empty, a block is []. If , the result is an empty string.
Input
The first line contains , which may be empty. The second contains integer .
Output
Print copies of block [s] on one line. Print an empty line when .
Subtasks
- Subtask 1 (100 points): Unicode characters; .
Examples
Example 1
Input
ab
3
Output
[ab][ab][ab]
Explanation. The block is [ab]; three entire copies give [ab][ab][ab].
Example 2
Input
2
Output
[][]
Explanation. Because is empty, each block is []; two blocks give [][].
Example 3
Input
X
0
Output
Explanation. With , no block is printed and the output is empty.