Help me in solving AOCC20 problem

My issue

my output didn’t getting matched

My code

#include <iostream>
#include <vector>

using namespace std;

int max_students_cooking(const vector<int>& A, const vector<int>& B) {
    int n = A.size();
    int count = 0;
    int current_time = 0;

    for (int i = 0; i < n; ++i) {
        if (current_time + B[i] <= A[i]) {
            // If the sum of current time and cooking time is less than or equal to the scheduled finish time,
            // the student can cook without violating the schedule
            current_time += B[i];
            count++;
        }
    }

    return count;
}

int main() {
    int T;
    cin >> T;

    while (T--) {
        int N;
        cin >> N;

        vector<int> A(N);
        vector<int> B(N);

        for (int i = 0; i < N; ++i) {
            cin >> A[i];
        }

        for (int i = 0; i < N; ++i) {
            cin >> B[i];
        }

        int result = max_students_cooking(A, B);
        cout << result << endl;
    }

    return 0;
}

Learning course: Solve Programming problems using C++
Problem Link: Review problem - 5 Practice Problem in Solve Programming problems using C++ - CodeChef

@shivhar_45
here refer my c++ code for better understanding of the logic

// Update the code below to solve the problem

#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N;
	    cin >> N;
	    int A[N], B[N];
	    int ans=0;
	    for(int i=0; i < N; i++)
	    {
	        cin >> A[i];  
	    }
	    for(int i=0; i < N; i++)
	    {
	        cin >> B[i];  
	    }
	    if(A[0]>=B[0])
	    ans++;
	    for(int i=1;i<N;i++)
	    {
	        if(A[i]-A[i-1]>=B[i])
	        ans++;
	    }
	    
	    cout<<ans<<endl;
	}
}