SP13978 BBM - Billion ByteMan March

Description

N/A

Input Format

The input starts with 2^12 useful precomputed values: factorial(i) MOD M7 for i in \[0 ; 2^30\[ with a step of 2^18, each one on one line. The input continues with the number T of test cases in a single line. In each of the next T lines there are two integers : N, K. N is the quantity of bus that came to the meeting. K is the common capacity of each bus.

Output Format

For each test case, your task is to calculate the number of ways people can form homogeneous teams.