F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

A Chocolate Manufacturer's Problem

Time 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
3 0 0 0 1 1 0 0.28 3 0 0 0 1 1 0 0.3 0
 

Sample Output
Yes No
 

Hint

Here is a picture illustrated the first case. It may be helpful for you to understand the problem.

 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 04:07:32, Gzip enabled