Factorial Program

#include<stdio.h>
int main()
{
unsigned long int range,i;
unsigned long int ptr;
int cnt=0;
scanf("%lu",&range);
ptr=(unsigned long int ) malloc(rangesizeof(unsigned long int));
for(i=0;i<range;i++){
scanf("%lu",ptr+i);
}
for(i=0;i<range;i++){
while(
(ptr+i)>5){
cnt=cnt+(*(ptr+i)/5);
(ptr+i)=((ptr+i)/5);
}printf("%d\n",cnt);
cnt=0;}
return 0;
}

according to my point of view there is no problem with this code and also it’s displaying desired output.however i m getting wrong answer at the time of submission, Please help me to find reason of rejection.

//