include
define N 1000000000
int arr[N/5] = {0};
int main () {
long i,j,k,m=0;
for(i = 5; i < N+1; i+=5) {
int c=0,k=i;
while(k % 5 == 0) {
k /= 5;
c++;
}
m += c;
arr[i/5] = m;
}
scanf("%ld",&j);
for(i=0;i<j;i++){
scanf("%ld",&k);
printf("%d\n",arr[k/5]);
}
}
This is the solution for the problem; works perfectly on our local machine but experiencing a run-time error, are we missing something??