Help me in solving ATM2 problem

My issue

Explain lines of code

My code

#include <stdio.h>

int main(void) {
	int T,j,N,K,i;
	int A[i];
	scanf("%d", &T);
	for(j=0; j<T;  j++){
	    scanf("%d %d", &N, &K);
	    scanf("%d", &A[i]);
	    for(i=0; i<N; i++){
	    if(A[i]<=K){
	        K=K-A[i];
	        printf("1");
	        
	    }else{
	        printf("0");
	    }
	    }
	    
	    
	    printf("\n");
	}
return 0;
}


Learning course: 1000 to 1400 difficulty problems
Problem Link: ATM Machine Practice Problem in - CodeChef

@rysa_108
what did u not get in this code??

What is wrong in the code as it is not running