Google kickstart

i have problem in record break ques
i wrote this code and was giving WA but a small change of removing if(a[0]>a[1])
c++; and starting the loop from 0 got the code submitted…can someone help?
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll t;
cin>>t;
ll x=1;
while(t–)
{
ll n;
cin>>n;
ll a[n];
ll i;
for(i=0;i<n;i++)
cin>>a[i];
ll c=0,max=a[0];
if(a[0]>a[1])
c++;
for( i=1;i<n-1;i++)
{

if(a[i]>a[i+1]&&a[i]>max)
c++;
if(a[i]>max)
max=a[i];

}
if(i==n-1&&a[i]>max)
c++;
cout<<“Case #”<<x<<":"<<c<<endl;
x++;
}
}

if(a[0]>a[1])
c++;
this will cause index out of bound access for array a[n] if n is equal to 1.
this code works fine.