#K52682. Maximizing Watered Plants

    ID: 29364 Type: Default 1000ms 256MiB

Maximizing Watered Plants

Maximizing Watered Plants

You are given several test cases. In each test case, there are n plants and D available days. For each plant, a watering interval is given, which is the number of days required between two consecutive waterings. A plant can only be watered on schedule if the available days D is at least as many as its watering interval. In other words, a plant is waterable if \(D \geq w_i\), where \(w_i\) is the watering interval for that plant.

Your task is to determine and print the number of plants that can be watered on schedule for each test case.

Note: The input is given via standard input (stdin) and the output should be printed to standard output (stdout). Each result should be output on a new line.

inputFormat

The first line contains a single integer \(T\) indicating the number of test cases. Each test case consists of two lines:

  • The first line contains two integers \(n\) and \(D\), where \(n\) is the number of plants and \(D\) is the total number of days available.
  • The second line contains \(n\) space-separated positive integers, where the \(i\)-th integer represents the watering interval \(w_i\) for the \(i\)-th plant.

outputFormat

For each test case, output a single integer on a new line representing the maximum number of plants that can be watered exactly on schedule.

If a plant's watering interval is greater than \(D\), it cannot be watered on schedule.

## sample
3
5 10
2 3 5 3 4
4 7
1 2 3 4
6 15
2 4 6 8 10 12
5

4 6

</p>