understanding INTEST problem

i want UNDERSTAND the “buff_read” steps of this code

int main()
{
unsigned long n,k,t=0;
char buff[size];
unsigned long count=0,divisible=0;
int buf_read=0,is_first=0,i;
scanf("%lu %lu",&n,&k);
while(n--){
    buf_read=fread(buff,1,size,stdin);
    for(i=0;i<buf_read;i++){
        if(buff[i]=='\n'){
            if(is_first){
                count++;

                if(t%k==0)
                    divisible++;
                t=0;
            }
            else
                is_first=1;
        }
        else
            t=t*10+(buff[i]-'0');
    }
}
printf("%lu\n",divisible);
return 0;
}

how the iteration is going on
please any one help me
thanks in advance…