#K75382. Maximum Number of Teams

    ID: 34407 Type: Default 1000ms 256MiB

Maximum Number of Teams

Maximum Number of Teams

You are given several test cases. For each test case, there are N departments and each department has a certain number of members. A team is formed using exactly K members irrespective of their department.

The task is to determine the maximum number of teams that can be formed, given that the total number of teams is the floor of the sum of all members divided by K. In mathematical terms, for each test case:

teams = \(\left\lfloor \frac{\displaystyle \sum_{i=1}^{N} A_i}{K} \right\rfloor\)

Use this logic to solve the problem for multiple test cases.

inputFormat

The input begins with an integer T, representing the number of test cases. For each test case, the first line contains two space-separated integers N and K, where N is the number of departments and K is the required number of members for one team. The second line contains N space-separated integers representing the number of available members in each department.

outputFormat

For each test case, output a single integer on a new line denoting the maximum number of teams that can be formed.## sample

2
3 5
10 10 10
2 3
7 9
6

5

</p>