#P10988. [2015杭电多校]Hack it!
[2015杭电多校]Hack it!
Hack it!
Problem Description
Let be a hash function of string . If ,. Teacher Mai wants to find two different regular bracket sequences with the same length and the same hash value, where w("(")=,w(")")=. Let us define a regular brackets sequence in the following way: Empty sequence is a regular sequence. If is a regular sequence, then is regular sequences. If and are regular sequences, then is a regular sequence.
Input
There are multiple test cases. All the test cases are generated randomly. For each test case, there is one line contains four numbers
Output
For each test case, print two different regular bracket sequences with the same length and the same hash value
Sample Input
4 7 37 10
Sample Output
((()))
()()()
Author
xudyh
Source
2015 Multi-University Training Contest 9