You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
701 B

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> PII;
const int N = 110;
const int MOD = 1e9 + 7;
unordered_map<int, int> primes;
int n;
signed main() {
cin >> n;
while (n--) {
int x;
cin >> x;
for (int i = 2; i <= x / i; i++)
while (x % i == 0) {
x /= i;
primes[i]++;
}
if (x > 1) primes[x]++;
}
int res = 1;
for (auto p : primes) {
int a = p.first, b = p.second; // 质数,几个
int t = 1;
while (b--) t = (t * a + 1) % MOD;
res = res * t % MOD;
}
printf("%lld\n", res);
}