시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
8 초 | 512 MB | 6 | 0 | 0 | 0.000% |
Your friend, Tatsumi, is a producer of Immortal Culture Production in Chiba (ICPC). His company is planning to form a zombie rock band named Gray Faces and cheer Chiba Prefecture up.
But, unfortunately, there is only one zombie in ICPC. So, Tatsumi decided to release the zombie on a platform of Soga station to produce a sufficient number of zombies. As you may know, a zombie changes a human into a new zombie by passing by the human. In other words, a human becomes a zombie when the human and a zombie are at the same point. Note that a zombie who used to be a human changes a human into a zombie too.
The platform of Soga station is represented by an infinitely long line, and Tatsumi will release a zombie at a point with coordinate $x_Z$. After the release, the zombie will start walking in the positive direction at $v_Z$ per second. If $v_Z$ is negative, the zombie will walk in the negative direction at $|v_Z|$ per second.
There are $N$ humans on the platform. When Tatsumi releases the zombie, the $i$-th human will be at a point with coordinate $xi$ and will start walking in the positive direction at $vi$ per second. If $v_i$ is negative, the human will walk in the negative direction at $|vi|$ per second as well as the zombie.
For each human on the platform, Tatsumi wants to know when the human becomes a zombie. Please help him by writing a program that calculates a time when each human on the platform becomes a zombie.
The first line of the input consists of an integer $N$ ($1 \le N \le 2 \cdot 10^5$) which is the number of humans on a platform of Soga station. The second line consists of two integers $x_Z$ ($-10^9 \le x_Z \le 10^9$) and $v_Z$($-10^9 \le v_Z \le 10^9$) separated by a space, where $x_Z$ is an initial position of a zombie Tatsumi will release and $v_Z$ is the velocity of the zombie.
The $i$-th line in the following $N$ lines contains two integers $x_i$ ($-10^9 \le x_i \le 10^9$) and $v_i$ ($-10^9 \le v_i \le 10^9$) separated by a space, where the $x_i$ is an initial position of the $i$-th human and $v_i$ is the velocity of the human. There is no human that shares their initial position with the zombie. In addition, initial positions of the humans are different from each other.
Print $N$ lines. In the $i$-th line, print how many seconds it will take for the $i$-th human to become a zombie. If the $i$-th human will never become a zombie, print $−1$ instead. The answer will be considered as correct if the values output have an absolute or relative error less than $10^{-9}$.
6 3 1 -5 0 5 0 -4 -3 0 -2 6 -3 2 -1
3.66666666666667 2.00000000000000 -1 6.00000000000000 0.75000000000000 2.00000000000000
5 31415 -926 5358 979 323846 26 -433832 7950 288 -4 -1971 -69
13.67821522309711 95.61812216052499 52.41629112212708 33.76030368763558 38.95682613768962