Codechef•Jun 16, 2025
Airlines
Hazrat Ali
Codechef
An airline operates X aircraft every day. Each aircraft can carry up to 100 passengers.
One day, N passengers would like to travel to the same destination. What is the minimum number of new planes that the airline must buy to carry all N passengers?
Input Format
- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of a single line containing two space-separated integers X and N the number of aircraft the airline owns and the number of passengers travelling, respectively.
Output Format
- For each test case, output the minimum number of planes the airline needs to purchase.
Constraints
- 1≤T≤1000
- 1≤X≤106
- 1≤N≤106
Sample 1:
Input
3 4 600 3 523 8 245
Output
2 3 0
Solution
import math
T = int(input())
for _ in range(T):
X, N = map(int, input().split())
passengers = X * 100
if passengers >= N:
print(0)
else:
airline = N - passengers
destination = (airline + 99) // 100
print(destination)