#K71507. Minimum Number of Advertisements
Minimum Number of Advertisements
Minimum Number of Advertisements
You are given several test cases. In each test case, you have N videos and an advertisement of length A seconds. Each video has a length given in seconds. For each video, you need to insert advertisements such that the entire video is covered, and advertisements are inserted uniformly. In other words, for a video of length L, the number of advertisements needed is \( \lceil \frac{L}{A} \rceil \). Your task is to compute the total minimum number of advertisements required for each test case.
Input: The first line contains the number of test cases \( T \). For each test case, the first line contains two integers \( N \) and \( A \): the number of videos and the advertisement length respectively. The next line contains \( N \) space-separated integers representing the lengths of the videos.
Output: For every test case, output the total minimum number of advertisements required on a new line.
Examples:
Input:
3
3 10
20 30 40
2 5
8 12
1 7
25
Output:
9
5
4
inputFormat
The first line of input contains an integer \( T \) indicating the number of test cases. For each test case, the first line contains two integers \( N \) and \( A \) separated by a space, where \( N \) is the number of videos and \( A \) is the length (in seconds) of each advertisement. The next line contains \( N \) space-separated integers representing the lengths of the videos in seconds.
outputFormat
For each test case, output a single line containing the total minimum number of advertisements required such that every video has enough advertisements to cover its length.
## sample3
3 10
20 30 40
2 5
8 12
1 7
25
9
5
4
</p>