Help me in solving HILLS problem

My issue

what is error in this code.

My code

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

int main() {
	// your code goes here
int t;
cin>>t;
while(t--){
    int n,u,d;
    cin>>n>>u>>d;
    int c=1;
    int j=1;
    vector<int> h(n);
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    for(int i=1;i<n;i++){
        if(h[i]-h[i-1]<=u){
            c++;
        }
        else if(h[i-1]-h[i]<=d) c++;
        else if(h[i-1]-h[i]>d && j==1){
            c++;
            j--;
        }
        else
        {
            break;
        }
    }
    cout<<c<<endl;
}
}

Problem Link: Jumping in the hills Practice Coding Problem