UVa 10312 - Expression Bracketing

Hint 1

It's Super Catalan Numbers - Catalan Numbers.

Explanation: Super Catalan Numbers calculate all possible bracketings. Catalan numbers calculate all binary bracketings.

Hint 2

In case you get TLE just hardcode!