#P11255. [GDKOI2023 普及组] 淋雨
[GDKOI2023 普及组] 淋雨
Problem Description
Moon finds that he has come to a 2D plane, but he can only walk on the line with speed no more than (he may turn around and walk back and forth). At this moment, a heavy rain starts. There are raindrops. The -th raindrop starts from and falls straight down at a constant speed . Meanwhile, a strong wind starts blowing with speed in the positive -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 -axis, Moon is exactly at the same position.
Now there are queries. The -th query gives an initial position . Moon wants to know: starting from , during his entire movement, what is the maximum number of raindrops that can hit him?
Input Format
The first line contains five integers .
The next lines each contain two integers .
The next lines each contain one integer .
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, , , .
For of the testdata, .
For another of the testdata, .
Translated by ChatGPT 5