Ace Consumer Mobiles (ACM) is currently receiving complaints about the quality of their mobile phone service in some locations of the city. Hence, your team needs to resolve the problem. As a starting point, your boss decides to check whether the current locations of the mobile base stations would cause some problems.
The base stations of ACM works as follows. Each base station a operates with signal of a fixed
power level Pa . The physical laws state that the strength of the signal would then decrease proportional
to the squared distance between the user and the base station. That is, if the user is of Euclidean
distance d to some base station a, the signal strength that the user’s phone can sense from the base
station is Qa = Pa / d2.
After several days of checking, you have an important finding. “Sir, I think I found the reason.
All the locations that raised complaints share one important property: competing signals between two
or more base stations.”
“Very good”, your boss says. It is a known problem with this transmission protocol, then. Let’s
say that a phone senses signals of strength Qa and Qb from base stations a and b. If both Qa and Qb are no less than some level , the two signals would compete with each other, making the mobile phone unable to function perfectly.
The ideal solution, then, is to decrease the power level of some of the base stations. But there are too many base stations to be tuned individually. Thus, your boss decides to try an approximate solution. “Can we set the Pa of every base station a to a constant to avoid the hazard of competing signals?”
Now, it is you, the engineer, who has to answer this question from your boss.
The input file contains a set of test data. The first line of each set is the number of base stations
N , which is between 2 and 40000. Each of the next N lines contains two integers xn and yn , which denotes the position (xn , yn ) of the n-th base station. Both xn and yn would be between 1 and 1000;
the positions of any two base stations would be different. Then, the last line of the set contains two numbers, an integer E that equals ( · 1000), and an integer
. E will be between 0 and 1000000 while
is between 1 and 1000. A test set that starts with N = 0 denotes the end of the test data.
For each test set with N > 0, output a line of three characters YES if using resolves the problem,
or a line of two characters NO if not.
2 3 1 1 3 4000 4 3 3 1 1 3 3 3 4000 4 0
YES NO
Migrated from old NTUJ.
The ACM-ICPC 2010 Asia Regional Contest, Site Kaohsiung
No. | Testdata Range | Score |
---|