반복문을 통해 문자열 S의 각 문자를 입력된 횟수 R만큼 반복하여 한 줄에 출력한다.
반복 출력은 문자열 연산자인 *
를 사용한다.
import sys
T = int(sys.stdin.readline())
cases = [list(sys.stdin.readline().split()) for _ in range(T)]
for c in cases:
# c[0]: 반복 횟수, c[1]: 반복할 문자열
for i in c[1]:
print(i*int(c[0]), end='')
print()