Problem M: Finding the Blueprint

Xem dạng PDF

Gửi bài giải

Điểm: 1,00
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 512M
Input: stdin
Output: stdout

Tác giả:
Dạng bài

Trong trường hợp đề bài hiển thị không chính xác, bạn có thể tải đề bài tại đây: Đề bài

The city is rolling out a project to expand public spaces by developing parks and squares to improve the quality of life for its residents. As part of the planning process, city officials have pinpointed two key strategic locations on the city map. These two sites, situated along a major roadway, were selected because of their proximity to densely populated neighborhoods and their strong connectivity to main traffic routes. The coordinates of these sites are A~(x1, y)~ and B~(x2, y)~.

In addition to these two strategic points, the city has identified ~n~ potential sites along the Ox axis. These sites are scattered across different areas and were chosen based on their development potential and infrastructure accessibility. City planners aim to combine the two fixed points with two of the ~n~ sites along the Ox axis to form a quadrilateral area, which will then be developed into a large park or public square.

However, to ensure the chosen area meets the development standards, each quadrilateral must have a minimum area of ~S~. Your task is to calculate the total number of ways the city can select sites to form quadrilaterals that meet the area requirement, in order to support the city's public space development plans.


Input

The first line contains two values ~n~ and ~S~ ~(1 ≤ n ≤ 2 · 10^5, 0 ≤ S ≤ 10^9)~ - which represent the number of points on the Ox axis and the minimum area.

The second line contains three integers ~x_1, x_2, y~ ~(1 ≤ x_1, x_2, y ≤ 10^9)~ - representing the coordinates of points ~A~ and ~B~.

The last line contains `~n~ values ~a_0, a_1, ..., a_{n-1}~ ~(1 ≤ ai ≤ 10^9)~ - representing the coordinates of the ~n~ new locations along the Ox axis.


Output

Print a single value, which is the number of ways to select that satisfy the problem's requirements.


Sample Input 1

5 7
1 3 3
1 2 3 4 5

Sample Ouput 1

3

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.