#C800. Sequential Order Processing Hours

    ID: 51934 Type: Default 1000ms 256MiB

Sequential Order Processing Hours

Sequential Order Processing Hours

One of the most important tasks in operations management is to estimate the total time required to complete a set of orders. In this problem, you are given T test cases. Each test case represents a sequence of orders that need to be processed sequentially.

For each order, you are given the number of units to be processed. A fixed number K of units can be processed in one hour. The time (in hours) to complete an order is calculated using the ceiling function:

$$\text{hours}_i = \lceil \frac{order_i}{K} \rceil$$

Your task is to compute the total number of hours required to process all orders in each test case by summing up the individual hours required for each order.

inputFormat

The input is read from stdin and has the following format:

  • The first line contains a single integer T, the number of test cases.
  • For each test case, the input consists of three parts:
    • A line containing an integer N, the number of orders.
    • A line containing N space-separated integers, where each integer represents the number of units for an order.
    • A line containing an integer K, the number of units that can be processed in one hour.

outputFormat

For each test case, output a single line (to stdout) containing the total number of hours required to complete all orders.

## sample
2
3
30 50 20
25
2
100 120
50
5

5

</p>