#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
inline bool isprime(int n);
inline long long pw(long long p, long long v);
constexpr int MAXN = 1e6 + 15;
constexpr int MAXM = 500;
constexpr int mod = 1e9 + 7;
int dp[MAXM][MAXM];
int q;
vector<pair<int, int> > vec[MAXN];
long long fact[MAXN << 3];
long long pw2[MAXN];
vector<int> prime;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> q;
  for (int i = 0; i < MAXM; i++) {
    for (int j = 0; j <= i; j++) {
      if (!j || !i) {
        dp[i][j] = 1;
        continue;
      }
      dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
    }
  }
  fact[0] = 1;
  for (int i = 1; i < (MAXN << 3); i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  pw2[0] = 1;
  pw2[1] = 2;
  for (int i = 2; i < MAXN; i++) {
    pw2[i] = (pw2[i - 1] << 1) % mod;
    if (isprime(i)) {
      vec[i].push_back({i, 1});
      prime.push_back(i);
    } else {
      int p = 0;
      while (true) {
        if (!(i % prime[p])) {
          pair<int, int> rex = {prime[p], 0};
          sort(vec[i / prime[p]].begin(), vec[i / prime[p]].end());
          vec[i] = vec[i / prime[p]];
          int x = lower_bound(vec[i / prime[p]].begin(),
                              vec[i / prime[p]].end(), rex) -
                  vec[i / prime[p]].begin();
          if (x == (int)vec[i / prime[p]].size()) {
            vec[i].push_back({prime[i], 1});
          } else if (vec[i / prime[p]][x].first == prime[p]) {
            vec[i][x].second += 1;
          } else {
            vec[i].push_back({prime[p], 1});
          }
          break;
        }
        p++;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    long long ret = 1;
    for (int i = 0; i < (int)vec[x].size(); i++) {
      long long xx = fact[vec[x][i].second + y - 1];
      long long yy = (fact[y - 1] * fact[vec[x][i].second]) % mod;
      xx = (xx * pw(yy, mod - 2)) % mod;
      ret = (ret * xx) % mod;
    }
    ret = (ret * pw2[y - 1]) % mod;
    cout << ret << '\n';
  }
}
inline bool isprime(int n) {
  if (n == 2) return true;
  if (!(n & 1)) return false;
  for (int i = 3; i * i <= n; i += 2) {
    if (!(n % i)) {
      return false;
    }
  }
  return true;
}
inline long long pw(long long p, long long v) {
  long long cur, res;
  cur = p;
  res = 1;
  while (v) {
    if (v & 1) {
      res *= cur;
      res %= mod;
    }
    v /= 2;
    cur *= cur;
    cur %= mod;
  }
  return res % mod;
}

### Prompt

Please provide a Cpp coded solution 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;
template <typename T, typename L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
inline bool isprime(int n);
inline long long pw(long long p, long long v);
constexpr int MAXN = 1e6 + 15;
constexpr int MAXM = 500;
constexpr int mod = 1e9 + 7;
int dp[MAXM][MAXM];
int q;
vector<pair<int, int> > vec[MAXN];
long long fact[MAXN << 3];
long long pw2[MAXN];
vector<int> prime;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> q;
  for (int i = 0; i < MAXM; i++) {
    for (int j = 0; j <= i; j++) {
      if (!j || !i) {
        dp[i][j] = 1;
        continue;
      }
      dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
    }
  }
  fact[0] = 1;
  for (int i = 1; i < (MAXN << 3); i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  pw2[0] = 1;
  pw2[1] = 2;
  for (int i = 2; i < MAXN; i++) {
    pw2[i] = (pw2[i - 1] << 1) % mod;
    if (isprime(i)) {
      vec[i].push_back({i, 1});
      prime.push_back(i);
    } else {
      int p = 0;
      while (true) {
        if (!(i % prime[p])) {
          pair<int, int> rex = {prime[p], 0};
          sort(vec[i / prime[p]].begin(), vec[i / prime[p]].end());
          vec[i] = vec[i / prime[p]];
          int x = lower_bound(vec[i / prime[p]].begin(),
                              vec[i / prime[p]].end(), rex) -
                  vec[i / prime[p]].begin();
          if (x == (int)vec[i / prime[p]].size()) {
            vec[i].push_back({prime[i], 1});
          } else if (vec[i / prime[p]][x].first == prime[p]) {
            vec[i][x].second += 1;
          } else {
            vec[i].push_back({prime[p], 1});
          }
          break;
        }
        p++;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    long long ret = 1;
    for (int i = 0; i < (int)vec[x].size(); i++) {
      long long xx = fact[vec[x][i].second + y - 1];
      long long yy = (fact[y - 1] * fact[vec[x][i].second]) % mod;
      xx = (xx * pw(yy, mod - 2)) % mod;
      ret = (ret * xx) % mod;
    }
    ret = (ret * pw2[y - 1]) % mod;
    cout << ret << '\n';
  }
}
inline bool isprime(int n) {
  if (n == 2) return true;
  if (!(n & 1)) return false;
  for (int i = 3; i * i <= n; i += 2) {
    if (!(n % i)) {
      return false;
    }
  }
  return true;
}
inline long long pw(long long p, long long v) {
  long long cur, res;
  cur = p;
  res = 1;
  while (v) {
    if (v & 1) {
      res *= cur;
      res %= mod;
    }
    v /= 2;
    cur *= cur;
    cur %= mod;
  }
  return res % mod;
}

```