Help me in solving ATM2 problem

My issue

write the remaining code

My code

#include <stdio.h>

int main()
{
    int t,n,k,i;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d%d",&n,&k)
        if(a>b)
    }
}

Problem Link: ATM Machine Practice Coding Problem

@sairohit2121
plzz refer the following c++ code for better understanding of the logic

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n,k;
	    cin>>n>>k;
	    int a[n];
	    for(int i=0;i<n;i++)
	    {
	        cin>>a[i];
	        if(a[i]<=k)
	        {
	            cout<<1;
	            k-=a[i];
	        }
	        else
	        cout<<0;
	    }
	    cout<<endl;
	}
	return 0;
}