section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not.
Detail code only else downvoted.
section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not.
You are given an integer n. You will likely develop and print precisely n diverse customary section arrangements of length 2n.
Input :The primary line contains one integer t (1≤t≤50) — the number of experiments. Each experiment comprises of one line containing one integer n (1≤n≤50).
Output :For each experiment, print n lines, each containing an ordinary section grouping of length precisely 2n. All section groupings you output for a testcase ought to appear as something else (however they might rehash in various experiments). In case there are different replies, print any of them. It tends to be shown that it's consistently conceivable
Step by step
Solved in 4 steps with 1 images