HOW TO RESOLVE "TIME LIMIT EXCEEDED" ERROR IN THIS PROBLEM?

PROBLEM LINK----https://www.codechef.com/problems/NUMFACT

CODE

#include<stdio.h>
int main()
{
int t,n,i,k,j,p=1,count=0;
long int a[100];
scanf("%d",&t);
for(i=0;i<t;i++)
{scanf("%d",&n);
for(j=0;j<n;j++)
{scanf("%ld",&a[j]);
p=p*a[j];}
for (k=1;k<=p;k++)
{if(p%k==0)
{count++;}}
printf("%d\n",count);}
p=1;
count=0;
return 0;}

//