Factorial....time limit exceeded

plzz tell me what should i modify in this to solve the error time limit exceeded
http://www.codechef.com/problems/FCTRL here is the question

#include<stdio.h>
int main()
{	int b=0;
	long int T;
	long long int N;
	scanf("%ld",&T);
	while(T>0)
	{	scanf("%lld",&N);
		b=0;
		while(N>1)
		{	if(N%5==0||N%10==0)
				b++;
			N--;
		}
		printf("%d",b);
		T--;
	}
	return(0);
}

Your algorithm is wrong.Also N is 10^9 which won’t run in the time limit.

//