Problem D. Parentheses Matrix
时间限制 1000 ms
内存限制 128 MB
A $\textit{parentheses matrix}$ is a matrix where every element is either '(' or ')'. We define the $\textit{goodness}$ of a parentheses matrix as the number of $\textit{balanced}$ rows (from left to right) and columns (from up to down). Note that:
- an empty sequence is balanced;
- if $A$ is balanced, then $(A)$ is also balanced;
- if $A$ and $B$ are balanced, then $AB$ is also balanced.
For example, the following parentheses matrix is a $2 \times 4$ matrix with goodness 3, because the second row, the second column and the fourth column are balanced:
)()(
()()
Now, give you the width and the height of the matrix, please construct a parentheses matrix with maximum goodness.
输入数据
输出数据
For each test case, display $h$ lines, denoting the parentheses matrix you construct. Each line should contain exactly $w$ characters, and each character should be either '(' or ')'. If multiple solutions exist, you may print any of them.
样例输入
样例输出
$ Mathjax font initiator $