#include using namespace std; const int MAXV = 18 * 100001, MOD = 998244353; int n, cnt, f[MAXV], inv[MAXV], Inv[MAXV]; void work() { inv[1] = f[0] = Inv[0] = 1; for(int i = 1; i < MAXV; ++i) { f[i] = 1ll * f[i - 1] * i % MOD; inv[i] = (i > 1 ? 1ll * (MOD - MOD / i) * inv[MOD % i] % MOD : 1); Inv[i] = 1ll * Inv[i - 1] * inv[i] % MOD; } } int C(int n, int m) { return (n < m ? 0 : 1ll * f[n] * Inv[m] % MOD * Inv[n - m] % MOD); } int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); cin >> n; work(); for(int i = 1, a, b; i <= n; ++i) { cin >> a >> b; for(int j = 2; j * j <= a; ++j) { for(; a % j == 0; a /= j, cnt++) { } } cnt += (a > 1); cout << C(cnt - 1, b - 1) << "\n"; } return 0; }