Help me in solving kitchen timetable problem

My code below is correct(showing no errors), but i don’t know why it is showing runtime error when i am running it. Problem Code: KTTABLE

include
using namespace std;

int main() {
// your code goes here
int t; cin>>t;
while(t–){
int n,i; int a1[n]; int b1[n]; int cnt=0;
cin>>n;
for( i=0;i<n;i++){
cin>>a1[i];
}

      for(i=0;i<n;i++){
        cin>>b1[i];
    }
    

        if(a1[0]>=b1[0]) cnt++;

for( i=0;i<n-1;i++){
  int  diff=a1[i+1]-a1[i];
  if(b1[i+1]<=diff){ 
        cnt++;

    }
    }

    cout<<cnt<<endl;
}
return 0;

}