DMOPC '19 Contest 2 P0 - Roller Coaster

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

You are working at an amusement park roller coaster. There is a line of N incoming children. However, each person needs to be at least height H_{min} and at most H_{max} for safety reasons. Given the heights of each child, h_1, h_2, \dots, h_N, count the number of children who can go on the ride. N, H_{min}, H_{max}, h_i are natural numbers.

Constraints

In all tests,
1 \le N \le 10^5
1 \le H_{min} \le H_{max} \le 10^6
1 \le h_i \le 2 \times 10^6

Input Specification

The first line contains three numbers separated by spaces: N, H_{min}, H_{max} the number of children in line, minimum height, and maximum height, respectively.
The second line contains N numbers separated by spaces, the height of each child: h_1, h_2, \dots, h_N.

Output Specification

Output on a single line, the total number of children who can go on the roller coaster.

Sample Input

10 7 12
2 4 1 7 8 10 11 3 9 6

Sample Output

5

Comments

There are no comments at the moment.