#include <bits/stdc++.h>
using namespace std;
vector<long long> fact(1001000, 1), invfact(1001000, 1);
vector<vector<long long>> primefact(1001000);
vector<bool> isprime(1001000, true);
vector<long long> primes;
long long egcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long g = egcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
long long inv(long long n) {
  long long x, y;
  egcd(1000000007, n, x, y);
  return (y % 1000000007 + 1000000007) % 1000000007;
}
long long comb(long long n, long long r) {
  return ((fact[n] * invfact[r]) % 1000000007 * invfact[n - r]) % 1000000007;
}
long long pow(long long n) {
  if (n == 0) return 1;
  long long s = pow(n / 2);
  s = (s * s) % 1000000007;
  if (n % 2) return (2 * s) % 1000000007;
  return s;
}
signed main() {
  for (long long i = 1; i < 1001000; i++) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
  }
  invfact[1000999] = inv(fact[1000999]);
  for (long long i = 1000998; i >= 0; i--) {
    invfact[i] = ((i + 1) * invfact[i + 1]) % 1000000007;
  }
  for (long long p = 2; p < 1001000; p++) {
    if (isprime[p]) {
      primes.push_back(p);
      for (long long q = p * p; q < 1001000; q += p) {
        isprime[q] = false;
      }
    }
  }
  vector<long long> temp(1001000);
  iota(temp.begin(), temp.end(), 0);
  for (long long p : primes) {
    for (long long q = p; q < 1001000; q += p) {
      long long k = temp[q], e = 0;
      while (k % p == 0) {
        k /= p;
        e++;
      }
      primefact[q].push_back(e);
    }
  }
  long long q;
  cin >> q;
  while (q-- > 0) {
    long long x, y;
    cin >> x >> y;
    long long ans = pow(y - 1);
    for (long long e : primefact[x]) {
      ans = ans * comb(e + y - 1, e) % 1000000007;
    }
    cout << ans << "\n";
  }
}

### 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;
vector<long long> fact(1001000, 1), invfact(1001000, 1);
vector<vector<long long>> primefact(1001000);
vector<bool> isprime(1001000, true);
vector<long long> primes;
long long egcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long g = egcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
long long inv(long long n) {
  long long x, y;
  egcd(1000000007, n, x, y);
  return (y % 1000000007 + 1000000007) % 1000000007;
}
long long comb(long long n, long long r) {
  return ((fact[n] * invfact[r]) % 1000000007 * invfact[n - r]) % 1000000007;
}
long long pow(long long n) {
  if (n == 0) return 1;
  long long s = pow(n / 2);
  s = (s * s) % 1000000007;
  if (n % 2) return (2 * s) % 1000000007;
  return s;
}
signed main() {
  for (long long i = 1; i < 1001000; i++) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
  }
  invfact[1000999] = inv(fact[1000999]);
  for (long long i = 1000998; i >= 0; i--) {
    invfact[i] = ((i + 1) * invfact[i + 1]) % 1000000007;
  }
  for (long long p = 2; p < 1001000; p++) {
    if (isprime[p]) {
      primes.push_back(p);
      for (long long q = p * p; q < 1001000; q += p) {
        isprime[q] = false;
      }
    }
  }
  vector<long long> temp(1001000);
  iota(temp.begin(), temp.end(), 0);
  for (long long p : primes) {
    for (long long q = p; q < 1001000; q += p) {
      long long k = temp[q], e = 0;
      while (k % p == 0) {
        k /= p;
        e++;
      }
      primefact[q].push_back(e);
    }
  }
  long long q;
  cin >> q;
  while (q-- > 0) {
    long long x, y;
    cin >> x >> y;
    long long ans = pow(y - 1);
    for (long long e : primefact[x]) {
      ans = ans * comb(e + y - 1, e) % 1000000007;
    }
    cout << ans << "\n";
  }
}

```