Help me in solving SPCP2 problem

My issue

please find the logical error

My code

#include <stdio.h>
int main(void) {
	// your code goes here
	int t;
	scanf("%d",&t);
	while(t--){
	    int x,n;
	    scanf("%d%d",&x,&n);
	    int c=n/100;
	    int d=n%100;
	    int f=(n-(x*100))/100;
	    if(c>x && d==0)
	    printf("%d\n",f);
	    else if(c>x && d!=0)
	    {
	    int g=f+1;
	    printf("%d\n",g);
	    }
	    else if(c<x)
	    printf("0\n");
     	}
	return 0;
}


Problem Link: Airlines Practice Coding Problem - CodeChef

@anon4568942
plzz refer the following code

#include <stdio.h>

int main(void) {
	int t,a,b,c;
	scanf("%d",&t);
	while(t--){
	    scanf("%d%d",&a,&b);
	    if(b%100==0){
	        c=b/100;
	    }else{
	        c=(b/100)+1;
	    }
	    if(c>=a){
	        printf("%d\n",c-a);
	
	    }else{
	        printf("0\n");
	    }
	    }
	return 0;
}