#K95867. Minimum Walls to Reinforce
Minimum Walls to Reinforce
Minimum Walls to Reinforce
You are given N walls with various heights. The cannon is powerful enough to destroy any wall whose height is less than or equal to H. In order to protect the fortress, you must determine the number of walls that need to be reinforced. A wall needs reinforcement if its height satisfies the condition \( \text{height} \leq H \).
Your task is to compute the minimum number of walls that should be increased in height to make them safe from the cannon's reach.
Input/Output: The program should read input from standard input (stdin) and write the answer to standard output (stdout).
inputFormat
The input consists of three lines:
- The first line contains an integer N, the number of walls.
- The second line contains N space-separated integers representing the heights of the walls.
- The third line contains an integer H, the maximum height that the cannon can destroy.
Note: All values are given in a single test case via stdin.
outputFormat
Output a single integer representing the number of walls that need reinforcement (i.e., those with height \( \leq H \)). The answer should be printed to stdout.
## sample5
1 2 3 4 5
3
3