cooling:why is it giving runtime error?

#include <stdio.h>
#include <stdlib.h>

   int cooling(int A[100],int B[100],int maxmA,int maxmB)
   {
int index=0,count=0,i,j;
for(j=0;j<=maxmA;j++)
{X:
    while(A[j]--)
    {
        for(i=index;i<=maxmB;i++)
        {
            while(B[i]--)
            {
            if(i>=j)
            {
                count++;
                index=i+1;
                goto X;
            }
        }
        }
    }
}

return count;

}

int main()
{
int t,n,i,j,k;
scanf("%d",&t);
for(i=0;i<t;i++)
{   int maxmA=0,maxmB=0,A[100]={0},B[100]={0};
    scanf("%d",&n);
    for(j=0;j<n;j++)
    {
        scanf("%d",&k);
        A[k]+=1;
        maxmA=((k>maxmA)?k:maxmA);
    }

    for( j=0;j<n;j++)
    {
        scanf("%d",&k);
        B[k]+=1;
        maxmB=((k>maxmB)?k:maxmB);
    }

    int a=cooling(A[100],B[100],maxmA,maxmB);
    printf("\n%d\n",a);

}
return 0;

}

Hello,

You do not need to give a size of an array while calling a function.
you can simply call a function like cooling(A,B,maxmA,maxmB);

thanks