fork download
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) throws IOException {
  9. int n = Integer.parseInt(br.readLine());
  10. for(int j=0;j<n;j++) {
  11. String[] str = br.readLine().split(" ");
  12. int num = Integer.parseInt(str[0]);
  13. String[] arry = str[1].split("");
  14.  
  15. for(int i=0;i<arry.length;i++) {
  16. for (int k = 0; k < num; k++) {
  17. System.out.print(arry[i]);
  18. }
  19. }
  20. }
  21. }
  22. }
  23.  
Success #stdin #stdout 0.04s 2184192KB
stdin
2
3 ABC
5 /HTP
stdout
AAABBBCCC/////HHHHHTTTTTPPPPP