what is wrong in my program

#include<stdio.h>
    int main()
    {
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,i;
        scanf("%d",&n);
        int a[n],b[n],s=0,m=0;
        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++)
        {
            s=s+b[i];
            if(s<=a[i])
                m++;
        }
        printf("%d\n",m);
    }
    return 0;
    }
No error in program but codechef is not accepting it....

The last for loop is wrong. Re-consider your thinking. Are you actually checking that a student has the time needed to cook some delicious pancakes?