m=1 ()
'(' < ')'

k=1 (())
k=2 ()()

            i
s1 s2 s3 s4 ( ....... count1 = dp[i+1,b+1]
s1 s2 s3 s4 ) ....... count2
if count1 >= k : '('
else : ')'; k -= count1

dp[?] = '('..... + ')'.....
? = i, b
dp[i,b] = dp[i+1,b+1] + (b?dp[i+1,b-1]:0)
dp[n, 0] = 1
dp[n, не ноль] = 0

balance=0
for i=0..n-1
  if s[i] == '('
    balance += 1
  else if (balance > 0)
    balance -= 1
  else
    не правильная
if (balance > 0)
  не правильная