Problem list
Log in
#r03204 · Online Judge > GoldOJ

SuperSum

Bronze I 2.0 s 256 MB

Define $\mathrm{SuperSum}(0, n) = n$ and $\mathrm{SuperSum}(k, n) = \sum_{i=1}^{n} \mathrm{SuperSum}(k-1, i)$. Answer $T$ queries: for each $k$, $n$ print $\mathrm{SuperSum}(k, n)$ (which equals $\binom{n+k}{k+1}$).

Input

Line 1: $T$ ($1 \le T \le 100$). Next $T$ lines: $k$ and $n$ ($1 \le k, n \le 14$).

Output

Print $\mathrm{SuperSum}(k, n)$ for each query, one per line.

Example 1

Input
4
1 3
2 3
4 10
10 10
Output
6
10
2002
167960
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code