Documente Academic
Documente Profesional
Documente Cultură
GoblinVsCannons
by puneetrai04
There is a rectangular field of size x with a number of cannons placed inside. Each cannon is described by its position
and it’s range . So, a cannon at position can shoot anyone in the radius . There are cannons on the field.
There is a goblin at position on the field. The goblin loves gold and tries to collect as much of it as he can. There is a gold
storage present at the position and the goblin wants to get to that storage to get the gold. But goblins are very weak, and
they will die even if a single cannon hits them. So, he can not step at a point which lies in the range of any cannon. You have to find
out if it is possible for the goblin to reach the gold storage without getting in the range of any cannon.
Note:
The goblin can move to any point inside the rectangular field. It has to stay inside the rectangle i.e. inside to .
The position and range of a cannon are NOT integers. They can be any real number.
The cannons can shoot at any position , if , where is the euclidean distance
between those points.
Input Format
The first line contains T, the number of test cases. In each test case,
The next lines contain 3 real numbers, the description of the cannons.
Constraints
Output Format
For each test case, print “Yes” (without quotes) if it is possible for the goblin to reach the gold storage. Otherwise print “No” (without
quotes).
Sample Input 0
2
10 10 3
5 5 1
5 7 1
8 5 2
10 10 4
5 5 1
5 7 1
8 5 2
2 5 2
Sample Output 0
Yes
No
Explanation 0
Submissions: 1
Max Score: 50
Difficulty: Medium
Line: 1 Col: 1
Upload Code as File Test against custom input Run Code Submit Code
Contest Calendar | Interview Prep | Blog | Scoring | Environment | FAQ | About Us | Support | Careers | Terms Of Service | Privacy Policy | Request a Feature