|
||||||||||
A Chocolate Manufacturer's ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2730 Accepted Submission(s): 535 Problem Description My mama always said£ºLife is like a box of chocolate, you never know what you are going to get. ¡ª¡ªFrom Forrest Gump ACM is a chocolate manufacturer. Inspired by the famous quote above, recently, they are designing a new brand of chocolate named Life. Each piece of chocolate is a random simple polygon. After molding and shaping, every piece is put in a small box. Until you open the box, you will not know what you will get: a huge piece or only a tiny fraction. It is really like life and that is the reason it is named for. However, here comes a problem. The manufacturer has to print the logo on each piece of chocolate. The logo is a circle with ¡®ACM¡¯ inside. Here is an example below. It is fortunate that the logo can be printed on the chocolate. Now the manufacturer is asking you for help. Given the information about the chocolate shape and the radius of the logo, you need to judge whether or not there is enough space to print the logo. Input The input contains no more than 20 cases, and each case is formatted as follows. n x1 y1 x2 y2 ¡ xn yn r The first line is the number of vertices of the polygon, n, which satisfies 3 ¡Ü n ¡Ü 50. Following n lines are the x- and y-coordinates of the n vertices. They are float numbers and satisfy 0 ¡Ü xi ¡Ü 1000 and 0 ¡Ü yi ¡Ü 1000 (i = 1, ¡, n). Line segments (xi, yi)¨C(xi+ 1 , yi + 1) (i = 1, ¡, n) and the line segment (xn, yn)¨C(x1, y1) form the border of the polygon. After the description of the polygon, a float number r follows, meaning the radius of the logo( r <= 1000). The input ends by a single zero. You may assume that the polygon is simple, that is, its border never crosses or touches itself. Output For each case, output ¡°Yes¡± if the logo is able to be printed on the chocolate, otherwise output ¡°No¡± instead. Sample Input
Sample Output
Hint Here is a picture illustrated the first case. It may be helpful for you to understand the problem. Source | ||||||||||
|