|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|2 초 (추가 시간 없음)||256 MB||2||2||2||100.000%|
Mr. Panda loves counting polygons. One day, he drew a circle with the unit radius and set $n$ points on the circle such that these points divide the circle into $n$ arcs with equal length. He is wondering how many different convex polygons he could generate if he selects $m$ points from these $n$ points and connects every two adjacent selected points with a line segment.
Two polygons are different if and only if they are not congruent. Two selected points are adjacent if there exist no other selected points on the arc between them. To avoid huge output data, you are only asked the answer modulo $(10^9 + 7)$.
There are multiple test cases. The first line of the input contains an integer $T$ ($1 \le T \le 10^4$), indicating the number of test cases. For each test case:
The first line contains two integers $n$ and $m$ ($3 \leq m \leq n \leq 10^7$).
For each test case, output the number of different polygons modulo $(10^9 + 7)$ in a single line.
4 3 3 4 3 5 3 7 4
1 0 1 3