Help me in solving TODOLIST problem

My issue

My code

#include <stdio.h>

int main(void) {
	// your code goes here
	int k,h,i,j,n,d[50];
	
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
	    scanf("%d",&k);
	    for(j=0;j<=k-1;j++)
	    {
	        scanf("%d",&d[j]);
	    }
	    if (d[j]>1000)
	    {
	        h++;
	    }
	}
  for(i=0;i<=n-1;i++)
  {
  printf("%d\n",h);
}
}


Problem Link: TODOLIST Problem - CodeChef

@prachisah66614
have corrected your code . have to make alot of changes though have written in simpler way hope u will get it.
include <stdio.h>

int main(void) {
// your code goes here
int k,h,i,j,n;

scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
    h=0;
    scanf("%d",&k);
    int d[k];
    for(j=0;j<=k-1;j++)
    {
        scanf("%d",&d[j]);
	    if (d[j]>=1000)
	    {
	        h++;
	    }
    }
    printf("%d\n",h);
}

}