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 Hmin and at most Hmax for safety reasons. Given the heights of each child, h1,h2,,hN, count the number of children who can go on the ride. N,Hmin,Hmax,hi are natural numbers.

Constraints

In all tests,
1N105
1HminHmax106
1hi2×106

Input Specification

The first line contains three numbers separated by spaces: N,Hmin,Hmax 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: h1,h2,,hN.

Output Specification

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

Sample Input

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

Sample Output

Copy
5

Comments

There are no comments at the moment.