https://www.acmicpc.net/problem/2675
using System;
using System.IO;
namespace baekjoon
{
class Program
{
static void Main(string[] args)
{
// 표준 입출력 스크림 reader, writer 만들기
// 첫째 줄에 테스트 케이스의 개수 입력받기, int로 바꾸기
// 테스트 케이스 개수만큼 각 테스트 케이스 입력받기
// 각 테스트 케이스마다 반복 횟수 R과 문자열 S를 공백으로 구분하여 입력받기
// 각 테스트 케이스를 분리하기, 반복 횟수 구하기, P 구하기, 결과 구하기
// 버퍼에 저장
// 버퍼 한 번에 비우기
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
string strTestCase = sr.ReadLine();
int nTestCase = int.Parse(strTestCase); // 2
for (int i = 0; i < nTestCase; i++) // 2번 반복
{
string strInput = sr.ReadLine(); // "3 ABC"
string[] strArr = strInput.Split(' '); // ["3", "ABC"]
int n = int.Parse(strArr[0]); // 3
for (int j = 0; j < strArr[1].Length; j++)
{
for (int k = 0; k < n; k++)
{
sw.Write(strArr[1][j]);
}
}
sw.WriteLine();
}
sw.Flush();
sr.Close();
sw.Close();
}
}
}