I checked the code in my computer also for different inputs.
enter code here
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<map>
using namespace std;
int main()
{
unsigned long test;
scanf("%lu",&test);
unsigned long clll[test];
unsigned long check;
map<int,long> m;
for(unsigned long i=0;i<test;i++)
{
unsigned long Num;
scanf("%lu",&Num);
m[2]=0;
m[5]=0;
for(unsigned long j=1;j<=Num;j++)
{
check=j;
while((check%2==0)&&(check>0))
{
m[2]++;
check/=2;
}
while((check%5==0)&&(check>0))
{
m[5]++;
check/=5;
}
}
clll[i]=m[2]>m[5]?m[5]:m[2];
}
for(int ni=0;ni<test;ni++)
printf("%lu\n",clll[ni]);
return 0;
}