P11255 [GDKOI2023 Junior] Getting Rained On

Description

Moon finds that he has come to a 2D plane, but he can only walk on the line $y = 0$ with speed no more than $v_c \space m/s$ (he may turn around and walk back and forth). At this moment, a heavy rain starts. There are $n$ raindrops. The $i$-th raindrop $(1 \le i \le n)$ starts from $(x_i, y_i)$ and falls straight down at a constant speed $v_g \space m/s$. Meanwhile, a strong wind starts blowing with speed $v_w \space m/s$ in the positive $x$-axis direction. You may assume that each raindrop gains a horizontal velocity equal to the wind speed, and the wind does not affect Moon’s walking speed. Moon really likes getting rained on. For simplicity, treat each raindrop and Moon as a point. Moon can be hit by a raindrop only if, at the moment that raindrop reaches the $x$-axis, Moon is exactly at the same position. Now there are $q$ queries. The $i$-th query $(1 \le i \le q)$ gives an initial position $(s_i, 0)$. Moon wants to know: starting from $(s_i, 0)$, during his entire movement, what is the maximum number of raindrops that can hit him?

Input Format

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 one integer $s_i$.

Output Format

For each query, output one integer per line, meaning the maximum number of raindrops that can hit Moon.

Explanation/Hint

### Constraints For all testdata, $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 testdata, $1 \le n, q \le 100$. For another $30\%$ of the testdata, $1 \le q \le 5$. Translated by ChatGPT 5