#K2526. Minimum Buses Required
Minimum Buses Required
Minimum Buses Required
Given several datasets, each representing a class of students, determine the minimum number of buses required so that every student can be seated. Each test case provides two parameters: n (the number of students) and c (the seating capacity of one bus). Although each test case also provides a list of student grades, these grades are not used in the calculation.
The formula to calculate the required number of buses is given by \(\lceil n/c \rceil = \frac{n+c-1}{c}\). The input terminates when a test case with 0 0
is encountered.
inputFormat
The input consists of several test cases. Each test case is described using two lines:
- The first line contains two integers n and c, where n is the number of students and c is the capacity of a bus.
- The second line contains n integers denoting the students' grades. These values are provided for each test case but are not used in calculating the answer.
The input terminates when a line with 0 0
is read.
outputFormat
For each test case, output a single line containing the minimum number of buses required.
## sample7 3
1 1 2 2 3 3 4
4 5
1 2 3 4
6 2
1 1 1 1 1 1
0 0
3
1
3
</p>