证明参考链接:http://t.csdnimg.cn/mjQxR
#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
typedef unsigned long long LL;
const int mod=1e9+7;
int main(){
int n;
cin>>n;
int x;
unordered_map<int,int> primes;
// 统计每个数的质因子数 => 累计到乘积的质因子数
while(n--){
cin>>x;
for(int i=2;i<=x/i;++i){
while(x%i==0){
x/=i;
primes[i]++;
}
}
if(x>1) primes[x]++;
}
LL res=1;
// 计算每个约数
for(auto prime :primes) {
LL p=prime.first;
LL a=prime.second;
LL t=1;
// 每个约数(质因子^幂次)的约数 质因子^(0-a)
while(a--) t=(t*p+1)%mod;
res=(res*t)%mod; // 乘积的约数之和
}
cout<<res;
return 0;
}