#include <bits/stdc++.h>
using namespace std;
inline long long input() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
const long long maxn = 1e6 + 50;
const long long mod = 1e9 + 7;
long long fact[maxn], inv[maxn];
bool mark[maxn];
inline long long power(long long a, long long b) {
  return b == 0 ? 1 : power(a * a % mod, b >> 1) * (b % 2 ? a : 1) % mod;
}
long long q[50], t, h, dii[maxn], cnt[maxn];
inline long long C(long long n, long long r) {
  return fact[n] * inv[r] % mod * inv[n - r] % mod;
}
inline void solve() {
  long long n = in(), m = in();
  t = h = 0;
  while (n > 1) {
    long long x = dii[n];
    q[t++] = x;
    cnt[x]++;
    n /= x;
  }
  long long res = 1;
  res = res * power(2, m - 1) % mod;
  for (long long i = 0; i < t; i++) {
    res = res * C(cnt[q[i]] + m - 1, cnt[q[i]]) % mod;
    cnt[q[i]] = 0;
  }
  printf("%lld\n", res);
}
inline void sieve() {
  dii[1] = 1;
  mark[1] = true;
  for (long long i = 2; i < maxn; i++) {
    if (mark[i]) continue;
    for (long long j = i * i; j < maxn; j += i) mark[j] = true, dii[j] = i;
    dii[i] = i;
  }
}
inline void pre_calc() {
  sieve();
  fact[0] = inv[0] = 1;
  for (long long i = 1; i < maxn; i++) {
    fact[i] = fact[i - 1] * i % mod;
    inv[i] = inv[i - 1] * power(i, mod - 2) % mod;
  }
}
int32_t main() {
  long long n = in();
  pre_calc();
  while (n--) solve();
}

### Prompt

Develop a solution in CPP to the problem described below:

You are given two positive integer numbers x and y. An array F is called an y-factorization of x iff the following conditions are met:

  * There are y elements in F, and all of them are integer numbers; 
  * <image>. 



You have to count the number of pairwise distinct arrays that are y-factorizations of x. Two arrays A and B are considered different iff there exists at least one index i (1 ≤ i ≤ y) such that Ai ≠ Bi. Since the answer can be very large, print it modulo 109 + 7.

Input

The first line contains one integer q (1 ≤ q ≤ 105) — the number of testcases to solve.

Then q lines follow, each containing two integers xi and yi (1 ≤ xi, yi ≤ 106). Each of these lines represents a testcase.

Output

Print q integers. i-th integer has to be equal to the number of yi-factorizations of xi modulo 109 + 7.

Example

Input

2
6 3
4 2


Output

36
6

Note

In the second testcase of the example there are six y-factorizations:

  * { - 4, - 1}; 
  * { - 2, - 2}; 
  * { - 1, - 4}; 
  * {1, 4}; 
  * {2, 2}; 
  * {4, 1}. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
inline long long input() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
const long long maxn = 1e6 + 50;
const long long mod = 1e9 + 7;
long long fact[maxn], inv[maxn];
bool mark[maxn];
inline long long power(long long a, long long b) {
  return b == 0 ? 1 : power(a * a % mod, b >> 1) * (b % 2 ? a : 1) % mod;
}
long long q[50], t, h, dii[maxn], cnt[maxn];
inline long long C(long long n, long long r) {
  return fact[n] * inv[r] % mod * inv[n - r] % mod;
}
inline void solve() {
  long long n = in(), m = in();
  t = h = 0;
  while (n > 1) {
    long long x = dii[n];
    q[t++] = x;
    cnt[x]++;
    n /= x;
  }
  long long res = 1;
  res = res * power(2, m - 1) % mod;
  for (long long i = 0; i < t; i++) {
    res = res * C(cnt[q[i]] + m - 1, cnt[q[i]]) % mod;
    cnt[q[i]] = 0;
  }
  printf("%lld\n", res);
}
inline void sieve() {
  dii[1] = 1;
  mark[1] = true;
  for (long long i = 2; i < maxn; i++) {
    if (mark[i]) continue;
    for (long long j = i * i; j < maxn; j += i) mark[j] = true, dii[j] = i;
    dii[i] = i;
  }
}
inline void pre_calc() {
  sieve();
  fact[0] = inv[0] = 1;
  for (long long i = 1; i < maxn; i++) {
    fact[i] = fact[i - 1] * i % mod;
    inv[i] = inv[i - 1] * power(i, mod - 2) % mod;
  }
}
int32_t main() {
  long long n = in();
  pre_calc();
  while (n--) solve();
}

```