Given a natural number
,
compute the number of correct parenthesizations with
opening and
closing parentheses, with just one restriction: the substring
“)()” is not allowed.
For instance, for
there are four correct parenthesizations: “(((())))”,
“(()(()))”, “(())(())” and
“()((()))”.
Input consists of several cases, each one with an between 1 and .
For each , print the result modulo .
Author: Xavier Povill
Generation: 2026-01-25T10:12:31.825Z
© Jutge.org, 2006–2026.
https://jutge.org