403378: GYM101147 D Popcorn

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Popcorntime limit per test2 secondsmemory limit per test64 megabytesinputpopcorn.inoutputstandard output

Maram and Marwa are an example of good friends. They know each other since they were in the kindergarten. One day, they went together to the movies after they bought two tickets for the famous movie "Avatar".

Since the movie is very exciting, the girls decided to get some Popcorn so they can enjoy the movie as much as possible. Unfortunately, There was only one packet left at the Popcorn corner at the theater. So Maram immediately ran and bought the packet before Marwa!

When the movie began, Maram started eating the Popcorn while Marwa sat and watched the movie sadly. So Maram decided to give Marwa some of her Popcorn. To be exact, she decided to give Marwa an amount of Popcorn as much as Marwa can carry in one hand.

Marwa knows that she can carry only M pieces in her hand, she is wondering, in how many ways can she pick the Popcorn pieces (all Popcorn pieces are unique). Can you help her?

Input

The first line of the input contains T the number of the test cases. Each test is represented with two integers on a single line. ( 0 < N ≤ 20 ) the number of the Popcorn pieces in the packet, ( 0 < M ≤ N ) the number of pieces Marwa can carry in one hand.

Output

For each test case print one line, the answer to Marwa's question.

ExampleInput
2
5 3
4 2
Output
10
6

加入题单

算法标签: