{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes in each piece to be attached. The pegs have a circular cross-section and so are intended to fit inside a round hole.\r\u003cbr\u003eA recent factory run of computer desks were flawed when an automatic grinding machine was mis-programmed. The result is an irregularly shaped hole in one piece that, instead of the expected circular shape, is actually an irregular polygon. You need to figure out whether the desks need to be scrapped or if they can be salvaged by filling a part of the hole with a mixture of wood shavings and glue.\r\u003cbr\u003eThere are two concerns. First, if the hole contains any protrusions (i.e., if there exist any two interior points in the hole that, if connected by a line segment, that segment would cross one or more edges of the hole), then the filled-in-hole would not be structurally sound enough to support the peg under normal stress as the furniture is used. Second, assuming the hole is appropriately shaped, it must be big enough to allow insertion of the peg. Since the hole in this piece of wood must match up with a corresponding hole in other pieces, the precise location where the peg must fit is known.\r\u003cbr\u003eWrite a program to accept descriptions of pegs and polygonal holes and determine if the hole is ill-formed and, if not, whether the peg will fit at the desired location. Each hole is described as a polygon with vertices (x1, y1), (x2, y2), . . . , (xn, yn). The edges of the polygon are (xi, yi) to (x\u003csub\u003ei+1\u003c/sub\u003e, y\u003csub\u003ei+1\u003c/sub\u003e) for i \u003d 1 . . . n − 1 and (xn, yn) to (x1, y1)."}},{"title":"Input","value":{"format":"HTML","content":"Input consists of a series of piece descriptions. Each piece description consists of the following data:\r\u003cbr\u003eLine 1 \u0026lt; nVertices \u0026gt; \u0026lt; pegRadius \u0026gt; \u0026lt; pegX \u0026gt; \u0026lt; pegY \u0026gt;\r\u003cbr\u003enumber of vertices in polygon, n (integer)\r\u003cbr\u003eradius of peg (real)\r\u003cbr\u003eX and Y position of peg (real)\r\u003cbr\u003en Lines \u0026lt; vertexX \u0026gt; \u0026lt; vertexY \u0026gt;\r\u003cbr\u003eOn a line for each vertex, listed in order, the X and Y position of vertex The end of input is indicated by a number of polygon vertices less than 3."}},{"title":"Output","value":{"format":"HTML","content":"For each piece description, print a single line containing the string:\r\u003cbr\u003eHOLE IS ILL-FORMED if the hole contains protrusions\r\u003cbr\u003ePEG WILL FIT if the hole contains no protrusions and the peg fits in the hole at the indicated position\r\u003cbr\u003ePEG WILL NOT FIT if the hole contains no protrusions but the peg will not fit in the hole at the indicated position"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 1.5 1.5 2.0\r\n1.0 1.0\r\n2.0 2.0\r\n1.75 2.0\r\n1.0 3.0\r\n0.0 2.0\r\n5 1.5 1.5 2.0\r\n1.0 1.0\r\n2.0 2.0\r\n1.75 2.5\r\n1.0 3.0\r\n0.0 2.0\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eHOLE IS ILL-FORMED\r\nPEG WILL NOT FIT\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}