Help me in solving SPCP2 problem

My issue

i cant find error

My code

# cook your dish here
T=int(input())
for i in range(T):
    X,N=map(int,input().split())
    if N-100*X>=0:
        
        Y=(N-100*X)//100
        print(Y)
    else:
        print(0)

Problem Link: Airlines Practice Coding Problem - CodeChef

include <stdio.h>

int main() {
int T;
scanf(ā€œ%dā€, &T);

for (int i = 0; i < T; i++) {
    int X, N;
    scanf("%d %d", &X, &N);

    int Total = X * 100;

    if (Total >= N) {
        printf("0\n");
    } else {
        int extra = (N - Total + 99) / 100; 
        printf("%d\n",extra);
    }
}

return 0;

}

You need to round up the values. When you already have 3 planes but want to carry 523 passengers, you have 223 passengers extra. You can just do 223//100, because then 23 passengers will be left out, instead you need to round up the value to the nearest integer.

Instead of

Y=(N-100*X)//100

use this

import math
Y = math.ceil((N - 100*X)/100)
1 Like