TLE problem
#include
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
int n;
cin>>n;
int *a=new int[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long int num=1;
float ans=0;
for(int i=0;i<n;i++){
num=num*a[i]; }
for(int j=1;j*j<=num;j++){
if(num%j==0){
ans++;
}
if(j*j==num){
ans=ans-0.5;
}
}
long long int tt=2*ans;
long long int fin=tt%(1000000007);
cout<<fin<<endl;
}
return 0;
}
Question link
https://hack.codingblocks.com/contests/c/452/815