| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 1 | 1 | 1 | 100.000% |
Prof. Pang is playing Plants vs Zombies.
Imagine that the game is played on a number axis. The following are the elements in the game:
Every second in the game is processed as follows:
Prof. Pang wants to know the death time (in seconds) of all the $n$ zombies.
The first line contains five integers $n,m,V,K,D$ (1ドル\le n,m \le 10^5, 1\le V,K,D \le 10^9$) separated by single spaces.
Each of the following $n$ lines contains two integers $t_i, h_i$ (1ドル\le t_i,h_i \le 10^9$) separated by a single space.
Each of the following $m$ lines contains two integers $p_i, a_i$ (1ドル\le p_i,a_i \le 10^9$) separated by a single space.
Output one line containing $n$ integers, where the $i$-th integer denotes the death time (in seconds) of the $i$-th zombie.
3 2 1 2 2 1 11 2 8 1 1 1 2 2 4
2 3 1
During the first second:
During the second second:
During the third second:
So the death times of the zombies are 2ドル,ドル 3ドル,ドル 1ドル,ドル respectively.