#K13581. Maximum Batch Size

    ID: 23944 Type: Default 1000ms 256MiB

Maximum Batch Size

Maximum Batch Size

Given a list of patience levels of friends and a minimum required patience level, determine the maximum number of friends that can join the ride together. In other words, count how many elements in the list are greater than or equal to the required patience level.

Formally, if the list of patience levels is \(A = [a_1, a_2, \dots, a_n]\) and the minimum required patience is \(m\), you need to compute:

\(\text{result} = |\{ i \mid a_i \ge m \}|\)

This problem tests your ability to process input and apply a simple counting condition.

inputFormat

The input consists of three lines:

  1. The first line contains an integer (n) ((1 \le n \le 10^5)) representing the number of friends.
  2. The second line contains (n) space-separated integers representing the patience levels of the friends.
  3. The third line contains an integer (m), the minimum required patience level to join the ride.

outputFormat

Output a single integer representing the maximum batch size, i.e. the number of friends whose patience level is at least (m).## sample

5
2 4 5 8 9
4
4