Help me in solving LUCKYN problem

My issue

My code

#include <stdio.h>

int main(void) {
	int t;
	scanf("%d",&t);
	while(t--){
	    while(X!=0){
	    int X;
	    scanf("%d",&X);
	    
	}
	return 0;
}


Problem Link: LUCKYN Problem - CodeChef