Chef and Easy Queries

‘’’ #include <stdio.h>

void main()
{
long n,k,i,j,testCase,counter=0,init=0;
scanf("%ld",&testCase);
long Ans[testCase];
for(i=0;i<testCase;i++)
{
scanf("%ld %ld",&n,&k);
long d[n];

for(j=0;j<n;j++)
{
scanf("%ld",&d[j]);
}

long current=d[init],rem=0;
while(rem >= 0)
{
if(n>1)
{
current=rem+d[init];
init++;
if(init<0)
init=0;
rem=current-k;
counter++;
}else{
rem=current-k;
counter++;
current=rem;
}
}
Ans[i]=counter;
init=0,counter=0,rem=0;
}
long in;
for(in=0;in<testCase;in++)
printf("%ld\n",Ans[in]);
} ‘’’

question link : Chef and Easy Queries | CodeChef

help me optimize it i am getting a nzec error… and also what can i do to avoid
this

give question link , and proper format the code by using three ``` before and after code.

Chef and Easy Queries | CodeChef

Bro I said backticks (``` key before 1 ) , not single quotes (’ ’ ')