Let M be the set of integers at most n by absolute value, that is, M=x∈Z:∣x∣≤n.
Let f_k(x) be the function f applied k times to an initial value x, that is, f_0(x)=x and f_i(x)=f(f_i−1(x)) for any i≥1.
Given the integers n and k, count the number of functions f(x) satisfying the following conditions:
As the answer may be very large, print it modulo 109+7.
The first line of input contains an integer T, the number of test cases (1≤T≤100).
Each test case contains a pair of positive integers n and k (n⋅k≤109).
The total sum of n⋅k over all test cases does not exceed 4⋅109.
For each test case, output the answer modulo 109+7 on a separate line.
If k=1, only the function f(x)=−x satisfies all requirements.
If n=k=2, two functions exist: