405376: GYM101917 I Water in BeagleTown
Description
There have been some really hot days in BeagleTown, so beagles have been training themselves to get enough water as fast as possible with the following exercise:
Googles places the water bowls with $$$w$$$ liters of water at specific locations. The beagles get to each of their starting positions and then they start the exercise: trying to drink 1 liter of water before $$$s$$$ seconds have passed.
Beagles are very good at their trainning, but they have a little problem: They are bad at designing the exercises. LH is out of town, so it is you task to make sure that the exercise they prepared is solvable.
InputThe first line of the input contain integers $$$n$$$, $$$m$$$ and $$$s$$$ ($$$1 \le n, m \le 2 000$$$) ($$$1 \le s \le 10^{10}$$$)
The next $$$n$$$ lines contain 2 integers each: $$$x_i$$$, $$$y_i$$$; starting position of the $$$i$$$ beagle. ($$$-10^9 \le x_i, y_i \le 10^9$$$)
The next $$$m$$$ lines contain 3 integers each: $$$x_j$$$, $$$y_j$$$, $$$w_j$$$; position and liters of water of the $$$j$$$ water bowl. ($$$-10^9 \le x_j, y_j \le 10^9$$$) ($$$1 \le w_j \le 100$$$)
OutputOutput the expected answer (without quotation marks):
"YES" if it is possible or
"NO" if it is not possible.
ExamplesInput3 3 20Output
-10 6
-4 9
-2 2
8 -4 4
4 0 100
-10 9 41
YESInput
3 3 15Output
3 -2
3 -1
-9 -8
-6 -4 34
5 4 11
-8 2 15
NONote
Beagles from BeagleTown love eating pears, but they can get only 1 pear per day.
Beagles move 1 unit per second.
Beagles drink 1 liter of water in 10 seconds.
Beagles organize themselves very well, if the exercise has a solution, 100% of the times they will find it.