QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#5819. Rainy

統計

Moon finds himself on a 2D plane, but he can only walk on the line $y=0$ at a speed not exceeding $v_c$ m/s (he can move back and forth). At this moment, it starts to pour with rain. There are $n$ raindrops in total. The $i$-th ($1 \le i \le n$) raindrop starts falling at a constant speed of $v_g$ m/s from $(x_i, y_i)$. At the same time, a strong wind starts blowing at a speed of $v_w$ m/s in the positive direction of the $x$-axis. It can be assumed that each raindrop acquires the same horizontal velocity as the wind, and the wind does not affect Moon's walking speed.

Moon loves getting rained on. For simplicity, both each raindrop and Moon are treated as points. Moon can only be hit by a raindrop if the raindrop reaches the $x$-axis at the exact same time and position as Moon. Now, given $q$ queries, where the $i$-th ($1 \le i \le q$) query provides an initial position $(s_i, 0)$, Moon wants to know the maximum number of raindrops he can be hit by, starting from $(s_i, 0)$ and moving throughout the entire process.

Input

The first line contains five integers $n, q, v_g, v_w, v_c$.

The next $n$ lines each contain two integers $x_i, y_i$.

The next $q$ lines each contain an integer $s_i$.

Output

For each query, output a single integer representing the maximum number of raindrops Moon can be hit by.

Constraints

For all data, $1 \le n, q \le 10^5$, $1 \le v_w, v_g, v_c, y_i \le 10^6$, $-10^6 \le x_i, s_i \le 10^6$.

For 30% of the data, $1 \le n, q \le 100$.

For another 30% of the data, $1 \le q \le 5$.

Examples

Input 1

4 4 1 1 5
-3 2
4 1
0 4
2 3
-4
1
-2
0

Output 1

2
3
2
3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.