I was solving national OI when I stumbled across this (simple?) problem which I was unable to solve.
"Given N and K find the k-th lexicographically correct parenthesis of length N".
Example:
N = 4 k = 2
()()
Thanks in advance! Hope this question will help somebody else too.