Sunteți pe pagina 1din 3

PRACTICE COMPETE JOBS LEADERBOARD  Search   isumit19 

All Contests  Crio Launch Assessment - 20-Dec-2019 8:00PM  GoblinVsCannons

GoblinVsCannons
by puneetrai04

Problem Submissions Leaderboard Discussions

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 first line contains 3 integers , and .

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

In the first example, it is possible for the goblin to go from to -

  

Contest ends in 2 hours

Submissions: 1
Max Score: 50
Difficulty: Medium

Rate This Challenge:



More

Current Buffer (saved locally, editable)      C++14   ⚙


1 ▾#include <cmath>
2 #include <cstdio>
3 #include <vector>
4 #include <iostream>
5 #include <algorithm>
6 using namespace std;
7
8
9 ▾int main() {
10 ▾    /* Enter your code here. Read input from STDIN. Print output to STDOUT */  
11    return 0;
12 }
13

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

S-ar putea să vă placă și