#K59927. Minimum Delivery Trips
Minimum Delivery Trips
Minimum Delivery Trips
You are given the total number of packages to be delivered on a route and the maximum number of packages a delivery person can carry in one trip. For each test case, you are required to determine the minimum number of trips needed to deliver all packages.
The number of trips for a delivery is given by the formula:
\( trips = \lceil \frac{N}{K} \rceil \)
where \(N\) is the total number of packages and \(K\) is the carrying capacity per trip.
Input is given via standard input (stdin) and the result must be printed to standard output (stdout). Each test case is independent.
inputFormat
The first line contains an integer \(T\) representing the number of test cases. Each of the following \(T\) lines contains two space-separated integers \(N\) and \(K\), where \(N\) is the total number of packages, and \(K\) is the maximum number of packages that can be carried in one trip.
Example:
3 10 3 15 5 20 4
outputFormat
For each test case, output the minimum number of trips required on a new line.
Example Output:
4 3 5## sample
3
10 3
15 5
20 4
4
3
5
</p>