why my answer is wrong

#include
#include
using namespace std;
int main()
{
int t,i,j;
cin>>t;
while(t–)
{
int n,u,d;
int flag=0,count=0;
cin>>n;
int a[n];
cin>>u>>d;
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=0;i<n-1;i++)
{
int w=abs(a[i+1]-a[i]);
//main part
if(a[i+1]>a[i] && w>u)
{
break;
}
if(w==0)
{
flag++;
}
if(a[i+1]>a[i] && w<=u)
{
flag++;
}
if(a[i+1]<a[i] && w>d && count==0 )
{
flag++;
count=1;
}
if(a[i+1]<a[i] && w>d && count==1 )
{
break;
}
if(a[i+1]<a[i] && w<=d)
{
flag++;
}
}

	cout<<flag+1<<endl;
}
return 0;

}
// it works fine in my compiler but codechef says its wrong
can anyone give me one case in which it will not work

The problem is because in the case of using parachute first a[i+1] < a[i] and w>d and count ==0 now you used the parachute and count =1 and just after that you are checking if(a[i+1] < a[i] and w>d and count==1) so this condition will always be satisfied after using parachute so your for loop will break even though in that case
you are supposed to use parachute and can continue to move further right so you add just a line of continue in your first if. By adding this single line i got AC see CodeChef: Practical coding for everyone

Can you give the question link