what is the error in this code for ADASTAIR

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

int main()
{
long long int t,n,k;
cin>>t;
long long int b[t];
for( long long int i=0;i<t;i++){
long long int count=0;
cin>>n>>k;
long long int a[n];

for(long long int j=0;j<n;j++){
cin>>a[j];
}
for(long long int j=0;j<n-1;j++){
long long int p=0;
p=a[j+1]-a[j];
while(p>k){
count++;
p=p-k;
}
}
if(a[0]>k)
count++;
cout<<count<<endl;
/// b[i]=count;
}

 /*for( long long int i=0;i<t;i++){
 cout<<b[i]<<endl;*/

}

please share link of your code