How to solve 4th problem of Newton challenge.

The problem is this :-

Saloni has two sets A and B, both of having N distinct elements. Sets A and B have exactly N - K same elements (K <= N). Therefore, exactly K elements differ in sets A and B. Now you insert both the sets into two lists C and D. Now Saloni loves the scenario when C[i] != D[i] for any value of i from 1 to N. You are allowed to permute both the arrays C and D. Find the number of ways in which Saloni loves the permutation of the two arrays modulo 1e9 + 7. (The total number of ways to permute both arrays = N! * N! )

**input :**

q (no. of queries)

n and k

**constraints :**

1 <= q <= 1e5

1 <= n <= 1e4

0 <= k <= n