Problem Description: vijay has just finished baking several burgers, and it's time to place them on cooling racks. vijay has exactly as many cooling racks as burgers. Each cooling rack can only hold one burger, and each burger may only be held by one cooling rack, but vijay isn't confident that the cooling racks can support the weight of the burgers. vijay knows the weight of each burger, and has assigned each cooling rack a maximum weight limit. What is the maximum number of burgers the vijay can cool on the racks? Constraints: T≤30 N≤30 Input Format: Input begins with an integer T≤30, the number of test cases. Each test case consists of 3 lines. The first line of each test case contains a positive integer N≤30, the number of burgers (and also the number of racks). The second and third lines each contain exactly positive N integers not exceeding 100. The integers on the second line are the weights of the burgers, and the integers on the third line are the weight limits of the cooling racks. Output Format: Print the maximum number of burgers vijay can place on the racks.
C Program

#include <stdio.h>

int no[32],w[32];

void sort(int arr[],int n)
{
    int i,j,temp;
    for(i=0;i<n-1;i++)
    {
        for(j=0;j<n-i-1;j++)
        {
            if(arr[j]>arr[j+1])
            {
                temp=arr[j];
                arr[j]=arr[j+1];
                arr[j+1]=temp;
            }
        }
    }
}

int main()
{
    int T;
    scanf("%d",&T);

    while(T--)
    {
        int n,i,j=0,count=0;
        scanf("%d",&n);

        for(i=0;i<n;i++)
            scanf("%d",&no[i]);   // burger weights

        for(i=0;i<n;i++)
            scanf("%d",&w[i]);    // rack limits

        sort(no,n);
        sort(w,n);

        i=0;
        j=0;

        while(i<n && j<n)
        {
            if(no[i]<=w[j])
            {
                count++;
                i++;
                j++;
            }
            else
                j++;
        }

        printf("%d\n",count);
    }

    return 0;
}