#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
void debugi(vector<int>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugd(vector<long double>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugl(vector<ll>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugmap(map<int, int>& mp) {
  for (auto x : mp) {
    cout << x.first << " " << x.second << " , ";
  }
  cout << endl;
}
void debugset(set<int>& st) {
  for (auto x : st) {
    cout << x << " ";
  }
  cout << endl;
}
void debugparri(vector<pair<int, int>>& arr) {
  for (int i = 0; i < (int)arr.size(); i++) {
    cout << "[" << arr[i].first << " : " << arr[i].second << "]"
         << " ";
  }
  cout << endl;
}
void debugpi(pair<int, int>& pi) {
  cout << pi.first << " " << pi.second << endl;
}
void debugq(queue<int> q) {
  while (!q.empty()) {
    cout << q.front() << " ";
    q.pop();
  }
  cout << endl;
}
bool check(int n, int i, int j) {
  if ((0 <= i & i < n) && (0 <= j & j < n)) {
    return true;
  }
  return false;
}
ll MOD = 1e9 + 7;
ll powab(ll a, ll b, ll mod) {
  if (b == 0) {
    return 1;
  }
  ll z = powab(a, b / 2, mod);
  ll res = (z * z * 1LL) % mod;
  if (b & 1) {
    res = (res * 1LL * a) % mod;
  }
  return res;
}
ll modinv(ll a, ll mod) {
  ll ans = powab(a, mod - 2, mod);
  return ans;
}
ll gcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void upd(int k, int x, vector<int>& tree, int n) {
  if (k == 0) {
    return;
  }
  while (k <= n) {
    tree[k] += x;
    k += (k & -k);
  }
}
ll sum(int k, vector<int>& tree, int n) {
  ll s = 0;
  while (k >= 1) {
    s += tree[k];
    k -= (k & -k);
  }
  return s;
}
ll mod = 1e9 + 7;
vector<int> primes(2000005, 1);
vector<int> smallest(2000005, 1);
vector<int> f(2000005, 1), invf(2000005, 1);
void fill() {
  for (int i = 2; i < 2000005; i++) {
    smallest[i] = i;
  }
  for (int i = 2; i * i < 2000005; i++) {
    if (primes[i] == 1) {
      for (int j = i * i; j < 2000005; j += i) {
        primes[j] = 0;
        smallest[j] = i;
      }
    }
  }
}
void fill1() {
  for (int i = 1; i < 2000005; i++) {
    ll num = i * 1LL * f[i - 1];
    num %= mod;
    f[i] = num;
  }
  ll last = powab(f[2000004], mod - 2, mod);
  invf[2000004] = last;
  for (int i = 2000003; i >= 0; i--) {
    invf[i] = (invf[i + 1] * 1LL * (i + 1)) % mod;
  }
}
vector<int> cntp(2000005, 0);
void solve(int tt) {
  int x, y;
  cin >> x >> y;
  vector<int> p;
  int num = x;
  while (num > 1) {
    cntp[smallest[num]] += 1;
    if (cntp[smallest[num]] == 1) {
      p.push_back(smallest[num]);
    }
    num = num / smallest[num];
  }
  ll mul = powab(2, y - 1, mod);
  ll res = 1;
  int len = p.size();
  for (int i = 0; i < len; i++) {
    int pn = p[i];
    int cnt = cntp[pn];
    cntp[pn] = 0;
    ll num = f[cnt + y - 1];
    num = (num * 1LL * invf[y - 1]) % mod;
    num = (num * 1LL * invf[cnt]) % mod;
    res = (res * 1LL * num) % mod;
  }
  res = (res * 1LL * mul) % mod;
  cout << res << endl;
  return;
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  fill();
  fill1();
  for (int tt = 0; tt < t; tt++) {
    solve(tt);
  }
  return 0;
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

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 ll = long long;
using ld = long double;
using namespace std;
void debugi(vector<int>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugd(vector<long double>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugl(vector<ll>& vec) {
  int n = (int)vec.size();
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
void debugmap(map<int, int>& mp) {
  for (auto x : mp) {
    cout << x.first << " " << x.second << " , ";
  }
  cout << endl;
}
void debugset(set<int>& st) {
  for (auto x : st) {
    cout << x << " ";
  }
  cout << endl;
}
void debugparri(vector<pair<int, int>>& arr) {
  for (int i = 0; i < (int)arr.size(); i++) {
    cout << "[" << arr[i].first << " : " << arr[i].second << "]"
         << " ";
  }
  cout << endl;
}
void debugpi(pair<int, int>& pi) {
  cout << pi.first << " " << pi.second << endl;
}
void debugq(queue<int> q) {
  while (!q.empty()) {
    cout << q.front() << " ";
    q.pop();
  }
  cout << endl;
}
bool check(int n, int i, int j) {
  if ((0 <= i & i < n) && (0 <= j & j < n)) {
    return true;
  }
  return false;
}
ll MOD = 1e9 + 7;
ll powab(ll a, ll b, ll mod) {
  if (b == 0) {
    return 1;
  }
  ll z = powab(a, b / 2, mod);
  ll res = (z * z * 1LL) % mod;
  if (b & 1) {
    res = (res * 1LL * a) % mod;
  }
  return res;
}
ll modinv(ll a, ll mod) {
  ll ans = powab(a, mod - 2, mod);
  return ans;
}
ll gcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void upd(int k, int x, vector<int>& tree, int n) {
  if (k == 0) {
    return;
  }
  while (k <= n) {
    tree[k] += x;
    k += (k & -k);
  }
}
ll sum(int k, vector<int>& tree, int n) {
  ll s = 0;
  while (k >= 1) {
    s += tree[k];
    k -= (k & -k);
  }
  return s;
}
ll mod = 1e9 + 7;
vector<int> primes(2000005, 1);
vector<int> smallest(2000005, 1);
vector<int> f(2000005, 1), invf(2000005, 1);
void fill() {
  for (int i = 2; i < 2000005; i++) {
    smallest[i] = i;
  }
  for (int i = 2; i * i < 2000005; i++) {
    if (primes[i] == 1) {
      for (int j = i * i; j < 2000005; j += i) {
        primes[j] = 0;
        smallest[j] = i;
      }
    }
  }
}
void fill1() {
  for (int i = 1; i < 2000005; i++) {
    ll num = i * 1LL * f[i - 1];
    num %= mod;
    f[i] = num;
  }
  ll last = powab(f[2000004], mod - 2, mod);
  invf[2000004] = last;
  for (int i = 2000003; i >= 0; i--) {
    invf[i] = (invf[i + 1] * 1LL * (i + 1)) % mod;
  }
}
vector<int> cntp(2000005, 0);
void solve(int tt) {
  int x, y;
  cin >> x >> y;
  vector<int> p;
  int num = x;
  while (num > 1) {
    cntp[smallest[num]] += 1;
    if (cntp[smallest[num]] == 1) {
      p.push_back(smallest[num]);
    }
    num = num / smallest[num];
  }
  ll mul = powab(2, y - 1, mod);
  ll res = 1;
  int len = p.size();
  for (int i = 0; i < len; i++) {
    int pn = p[i];
    int cnt = cntp[pn];
    cntp[pn] = 0;
    ll num = f[cnt + y - 1];
    num = (num * 1LL * invf[y - 1]) % mod;
    num = (num * 1LL * invf[cnt]) % mod;
    res = (res * 1LL * num) % mod;
  }
  res = (res * 1LL * mul) % mod;
  cout << res << endl;
  return;
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  fill();
  fill1();
  for (int tt = 0; tt < t; tt++) {
    solve(tt);
  }
  return 0;
}

```