#K51847. Count Problems in Difficulty Range

    ID: 29178 Type: Default 1000ms 256MiB

Count Problems in Difficulty Range

Count Problems in Difficulty Range

You are given a set of programming problems, each with an associated difficulty level. Your task is to count how many problems have a difficulty within the specified inclusive range \([L, R]\).

The input provides:

  • An integer \(T\) which represents the total number of problems.
  • A list of \(T\) integers, where each integer represents the difficulty level of a problem.
  • Two integers \(L\) and \(R\) that denote the lower and upper bounds of the difficulty range, respectively.

Your program should output a single integer: the count of problems whose difficulty level lies in the range \([L, R]\).

inputFormat

The input is read from stdin and is formatted as follows:

  1. The first line contains an integer \(T\), the number of problems.
  2. The second line contains \(T\) space-separated integers representing the difficulty levels of the problems.
  3. The third line contains two space-separated integers \(L\) and \(R\), the lower and upper bounds of the difficulty range.

outputFormat

The output should be written to stdout and consist of a single integer indicating the count of problems whose difficulty levels are within the inclusive range \([L, R]\).

## sample
5
1 5 10 20 30
10 20
2