提交记录
#include<bits/stdc++.h>
#define int long long
#define mod 998244353
using namespace std;
int p[1000010];
int buc[1000010];
priority_queue<int>q[1000010];
void pre(int x){
int sx = sqrt(x);
sx++;
for(int i = 2;i <= sx;i++){
bool ck = 0;
int aa = 0;
while(x % i == 0){
ck = 1;
aa++;
x /= i;
}
q[i].push(0 - aa);
}
if(x > 1)q[x].push(0 - 1);
}
void pre2(int x){
int sx = sqrt(x);
sx++;
for(int i = 2;i <= sx;i++){
int aa = 0;
while(x % i == 0){
aa++;
x /= i;
}
buc[i] = aa;
}
if(x > 1)buc[x]++;
}
signed main(){
int n,w;
cin >> n >> w;
for(int i = 1;i <= n;i++){
cin >> p[i];
pre(p[i]);
}
pre2(w);
for(int i = 1;i <= 10001;i++){
while(buc[i]){
buc[i]--;
int qq = q[i].top();
qq--;
q[i].pop();
q[i].push(qq);
}
}
int ans = 1;
for(int i = 1;i <= 10001;i++){
while(!q[i].empty()){
ans *= (0 - q[i].top() + 1);
ans %= mod;
q[i].pop();
}
}
cout << ans;
return 0;
}