#nt503. 组合数取模2

组合数取模2

组合数取模2

题目描述

回答TT组询问,输出(nm) mod 109+7{n \choose m} \bmod {10^9+7}的值。

输入格式

第一行一个整数TT表示数据组数。

每组数据,一行两个整数n,mn, m。

输出格式

对于每组数据,输出一行,表示答案。

样例输入

3 
5 2
50 20
500 200

样例输出

10
211914057
395607423

数据范围

对于所有数据,保证1≤T≤10,1≤m≤n≤1091\leq T\leq 10, 1\leq m\leq n\leq 10^9。