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
2016-01-11 23:53:50 abdou_93
AC first problem by BF
2015-03-09 21:16:38 Ognjen Arsenijevic
@ Tjandra Can you recommend me a book or give me site where I can learn brainf**k? I saw some tutorials but they were really short and not very useful.
2013-06-27 17:50:01 Akash
hah..finally AC after 2 hrs of long effort :)
my 2nd brainf**k problem on 1st day of my attempt to learn this language..
and makes my 61st problem in just 2 weeks of my programming career..feels awesome and relieved after this one..:D:D
2013-02-23 07:36:13 Ouditchya Sinha
@Tjandra, thank you for pointing out my mistake, this question is beyond me at the moment, I'll definitely try it again
in the future... :)
2013-01-12 06:11:20 Ouditchya Sinha
My code is working fine on ideone but here I'm getting TLE, please help. http://ideone.com/jQLZaY
Ans: You write an invalid code, try with this size: T=99, triangle size=99 and your code print wrong ans...

Last edit: 2013-01-12 08:26:55
2012-12-25 12:50:49 Vikas Kushwaha
@Tjandra
Can u tell me where my solution fails?
i have tried for most of the test cases.
I'm not able to figure it out.
Ans: No white-space caracter (ASCII 32) on a triangle...
Example:

Input:
5 _
Your Output:
_
_ _
_ _ _
_ _ _ _
_ _ _ _ _

Correct Output:
_
__
___
____
_____

----------------------
thank you.
got ac. :)

Last edit: 2012-12-26 04:54:47
2012-12-21 20:04:10 Mostafa 36a2
Thanks For The Ideas ...
Enjoy 10minutes solving :D
2012-12-15 18:55:45 (Tjandra Satria Gunawan)(曾毅昆)
Info: Changed cluster to 3GHz and mem limit to 1536 MB. Now all user that got AC in this problem AC with time=0.00sec. :-)
Edit: changed back to pyramid :-D

Last edit: 2012-12-20 17:11:25
2012-12-15 18:55:45 Aditya Pande
real good problem
2012-12-15 18:55:45 Jared Deckard
Maybe < and > are more costly than I thought. I ran both again, now my first submission gets .04s and the optimized one gets .06s :\

Great problem. Thank you.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.