3055Repeating Characters

3055   Repeating Characters

题目描述

For this problem,you will write a program that takes a string of characters,S,and creates a new string of characters,T,with each character repeated R times.That is,R copies of the first character of S,followed by R copies of the second character of S,and so on. Valid characters for S are the QR Code "alphanumeric" characters:

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ$%*+-./:

输入格式:

The first line of input contain a single integer P,(1<=P<=1000),which is the number of data sets that follow. Each data set is a single line of input consisting of the data set number N,followed by the string S.The length of string S will always be at least one and no more than 20 characters.All the characters will be from the set of characters shown above.

输出格式:

For each data set there is one line of output.It contains the data set number,N,followed by a single space which is then followed by the new string T,which is made of each character in S repeated R times

输入样例 复制
2
1 3 ABC
2 5 /HTP
输出样例 复制
1 AAABBBCCC 
2 /////HHHHHTTTTTPPPPP

说明

14
24
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度