String Repetition
InterviewTime limit1sMemory limit128 MB
Given repeat count R and string S, output the string formed by repeating each character of S exactly R times in order.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
You are given a repeat count R and a string S. Build a new string P by repeating each character of S exactly R times from left to right, then print P.
S contains only these characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ$%*+-./:.
Input
The first line contains the number of test cases T (1 ≤ T ≤ 1,000). Each test case contains a repeat count R (1 ≤ R ≤ 8) and a string S, separated by a space. The length of S is at least 1 and at most 20.
Output
For each test case, print the generated string P on its own line.