P2386 Placing Apples

Description

Place $m$ identical apples into $n$ identical plates. Empty plates are allowed. How many different distributions are there? ($5,1,1$ and $1,1,5$ are considered the same way.)

Input Format

The first line contains the number of testdata $t$. Each of the following lines contains two integers $m$ and $n$, separated by a space.

Output Format

For each pair $m$ and $n$ in the input, output the corresponding result on a single line.

Explanation/Hint

For all testdata, it is guaranteed that $1 \leq m, n \leq 10$, $0 \leq t \leq 20$. Translated by ChatGPT 5