#P11255. [GDKOI2023 普及组] 淋雨

[GDKOI2023 普及组] 淋雨

Problem Description

Moon finds that he has come to a 2D plane, but he can only walk on the line y=0y = 0 with speed no more than vc m/sv_c \space m/s (he may turn around and walk back and forth). At this moment, a heavy rain starts. There are nn raindrops. The ii-th raindrop (1in)(1 \le i \le n) starts from (xi,yi)(x_i, y_i) and falls straight down at a constant speed vg m/sv_g \space m/s. Meanwhile, a strong wind starts blowing with speed vw m/sv_w \space m/s in the positive xx-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 xx-axis, Moon is exactly at the same position.

Now there are qq queries. The ii-th query (1iq)(1 \le i \le q) gives an initial position (si,0)(s_i, 0). Moon wants to know: starting from (si,0)(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,vg,vw,vcn, q, v_g, v_w, v_c.

The next nn lines each contain two integers xi,yix_i, y_i.

The next qq lines each contain one integer sis_i.

Output Format

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

4 4 1 1 5
-3 2 
4 1 
0 4 
2 3 
-4
1
-2 
0
2
3
2
3
见/example/rain/下的 rain1.in 
见/example/rain/下的 rain1.out

Hint

Constraints

For all testdata, 1n,q1051 \le n, q \le 10^5, 1vw,vg,vc,yi1061 \le v_w, v_g, v_c, y_i \le 10^6, 106xi,si106-10^6 \le x_i, s_i \le 10^6.

For 30%30\% of the testdata, 1n,q1001 \le n, q \le 100.

For another 30%30\% of the testdata, 1q51 \le q \le 5.

Translated by ChatGPT 5