첫째 줄에 테스트 케이스의 개수 T(1 ≤ T ≤ 1,000)가 주어진다. 각 테스트 케이스는 반복 횟수 R(1 ≤ R ≤ 8), 문자열 S가 공백으로 구분되어 주어진다. S의 길이는 적어도 1이며, 20글자를 넘지 않는다.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt(); // 테스트 케이스의 개수
int R; // 반복횟수
String S;
for(int i=0;i<T;i++){
R = sc.nextInt();
S = sc.next();
for(int x=0, cnt=S.length();x<cnt;x++){
for(int y=0;y<R;y++){
System.out.print(S.charAt(x));
}
}
System.out.println();
}
}
}