WA in CARVANS

Can anyone tell me why it is giving WA. Thanks.

#include <iostream>
using namespace std;
int *a;
int main() {
int n,t,count=1;
scanf("%d",&t);
while(t--)
{
    scanf("%d",&n);
    a=new int[n];
    count=1;
 for(int i=0;i<n;i++)
     scanf("%d",&a[i]);
 
        for(int i=1;i<n;i++)
        {
            if(a[i]<a[i-1]){
            count++;
 
            }
        }
        printf("%d\n",count);
    }
	return 0;
}

Your are checking only front car’s speed.You have to check speed of all cars in front of that car.
For better information check editorial here

Here the link to the problem: