Misc [I]
View as PDFMiscellaneous [I]
You want to know how many ways you can organise  
( and ) brackets so the result string is balanced, that is, so that every closing ) bracket is preceded by an accompanying opening ( bracket somewhere earlier in the string.
Examples of all valid organisations with :
((()))()()()(())()()(())(()())
Examples of invalid organisations with :
())(())()()((()))(
Input
Input will consist of a single integer , representing the number of open and closed brackets we want to organise
Output
Output should be a single integer, representing the number of unique strings of balanced parenthesis of length . Since this number could be quite large, output the answer modulo 
Constraints
Example
Input
3
Output
5
Input
10
Output
16796
Comments