#p2407. combination

combination

###Description

LMZ有nn个不同的好友,他每天晚上要选mm个进行打牌,而且要求每天晚上的选择都不一样。那么LMZ能够持续多少个这样的夜晚呢?当然,LMZ的一年有1000710007天,所以他想知道答案mod10007mod\quad10007的值。(1mn200,000,0001\le m\le n\le200,000,000)

###Input

第一行一个整数tt,表示有tt组数据。(t200t\le200)

接下来t行每行两个整数n, m,如题意。

###Output

TT行,每行一个数,为C(n,m)mod10007C(n, m)\quad mod\quad10007的答案。

###Sample Input


4

5 1

5 2

7 3

4 2

###Sample Output


5

10

35

6