#T250. 鸣人的影分身

鸣人的影分身

Description

In the world of Naruto, keeping the enemy guessing is crucial. One of the signature techniques of our protagonist, Naruto Uzumaki—the Multiple Shadow Clone Jutsu—is a perfect example.
Shadow clones are created using Naruto's chakra energy. The more chakra used, the stronger the shadow clones become.
Depending on the battle scenario, Naruto can choose to create shadow clones of varying strengths—some for feints, others for decisive strikes.
Now, the question arises: Suppose Naruto's total chakra energy is M, and the maximum number of shadow clones he can create is N. How many different ways (denoted by K) are there to distribute the chakra when creating the shadow clones? (Note: A shadow clone can be allocated 0 chakra energy.)

Input Format

The first line contains the number of test cases, t (0 ≤ t ≤ 20).
Each subsequent line consists of two integers, M and N (1 ≤ M, N ≤ 10), separated by a space.

Output Format

For each input pair of M and N, output the corresponding value of K on a single line.

1
7 3


8