what is wrong with my code to display max output ??

#include<stdio.h>
#include<stdlib.h>
int main()
{ int T,N,i,A[100001],B[100001],C[100001],res[100001],max=0;

unsigned long int K;

scanf("%d",&T);

while(T–)
{
scanf("%d %d",&N,&K);

   for(i=0;i<N;i++)
   {
       scanf("%d",&A[i]);
   }
   for(i=0;i<N;i++)
   {
       scanf("%d",&B[i]);
   }
   for(i=0;i<N;i++)
   {
       C[i]=K/A[i];
   }
   for(i=0;i<N;i++)
   {
       res[i]=C[i]*B[i];
   }
   for(i=0;i<N;i++)
   { if(res[i]>max)

       max=res[i];
   }


   printf("%d\n",max);

}
return 0;
}