#P5525. Reachable Circle

    ID: 18757 Type: Default 1000ms 256MiB

Reachable Circle

Reachable Circle

In the 2D Cartesian plane, you are given n points. These points are considered reachable in the sense that if two points A and B are reachable then every point on the line segment joining A and B is also reachable; that is, the entire convex hull of the given points is reachable.

You are also given m circles. A circle is said to have the property that every point inside the circle is reachable if the entire disk (including the boundary) lies within the convex hull of the initial n points.

Input Format:
The first line contains an integer n, the number of points. Each of the following n lines contains two space-separated real numbers representing the coordinates (x, y) of a point. The next line contains an integer m, the number of circles. Each of the following m lines contains three space-separated real numbers: the x-coordinate, y-coordinate of the circle's center and its radius r.

Output Format:
For each circle, output a line containing "Yes" if every point inside the circle is reachable (i.e. if the circle is completely contained within the convex hull of the points), or "No" otherwise.

Note: All formulas are given in LaTeX format. For example, the reachable property can be expressed as: if points $A$ and $B$ are reachable, then any point $P$ on the segment $\overline{AB}$ is reachable. Thus, the reachable region is $\text{Conv}(\{P_1,P_2,\ldots,P_n\})$.

inputFormat

The input begins with an integer n indicating the number of points. The next n lines each contain two numbers representing the x and y coordinates of the points. This is followed by an integer m denoting the number of circles. Then, m lines follow, each containing three numbers: the x-coordinate, y-coordinate of the circle's center and its radius r.

outputFormat

For each circle, print "Yes" on a new line if the complete circle (disk) is contained within the convex hull of the given points. Otherwise, print "No".

sample

4
0 0
0 10
10 0
10 10
2
5 5 2
5 5 6
Yes

No

</p>