BFTRI - Drawing Triangles with Brainf##k

Your task is just to draw triangles! seems easy(?) but only Brainf**k programming language is allowed.

Input

The first line is an integer T (0 < T < 100), denoting the number of test cases. Then, T lines follow.

For each test case, there are one character c (ASCII(32) < c < ASCII(127)) and one integer i (0 < i < 100) written in one line, separated by a space. Each line end with ASCII(10).

Output

For each test case, output triangle size i (draw triangle using character c). See example.

Example

Input:
3
& 1
@ 3
? 5

Output:
&
@
@@
@@@
?
??
???
????
?????

See also: Another problem added by Tjandra Satria Gunawan


Added by:Tjandra Satria Gunawan
Date:2012-07-21
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:BF
Resource:Own Problem

hide comments
2012-12-15 18:55:45 Jared Deckard
I made a couple optimization, but my time didn't change. My final solution should be approx .01s faster than the first in the T=99, each i=99 case. More and larger test cases will allow the time to reflect performance more precisely.

Here is a weighted test case generator: http://ideone.com/BXiyl

Ans: Sorry but I think my test cases are ok with random test case generator (average i=48,33) and I agree with you, your final solution is .01 sec faster than before (in case #3: 99 triangles size 1-99), but maybe because SPOJ server instability: (in case #0: 1 triangle size 1) your final solution is .01 sec slower than your previous solution.

Last edit: 2012-07-22 07:56:08
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.