{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\r\n\tThe 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.\u003cbr /\u003e\r\n\tA recent factory run of computer desks were flawed when an automatic grinding machine was \u003cspan data-scayt_word\u003d\"mis-programmed\" data-scaytid\u003d\"2\"\u003emis-programmed\u003c/span\u003e. 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.\u003cbr /\u003e\r\n\tThere are two concerns. First, if the hole contains any protrusions (\u003cspan data-scayt_word\u003d\"i.e\" data-scaytid\u003d\"1\"\u003ei.e\u003c/span\u003e., 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.\u003cbr /\u003e\r\n\tWrite a program to accept \u003cspan data-scayt_word\u003d\"descri_ptions\" data-scaytid\u003d\"3\"\u003edescri_ptions\u003c/span\u003e 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 (\u003cspan data-scayt_word\u003d\"x1\" data-scaytid\u003d\"4\"\u003ex1\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"y1\" data-scaytid\u003d\"6\"\u003ey1\u003c/span\u003e), (\u003cspan data-scayt_word\u003d\"x2\" data-scaytid\u003d\"8\"\u003ex2\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"y2\" data-scaytid\u003d\"9\"\u003ey2\u003c/span\u003e), . . . , (\u003cspan data-scayt_word\u003d\"xn\" data-scaytid\u003d\"10\"\u003exn\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"yn\" data-scaytid\u003d\"12\"\u003eyn\u003c/span\u003e). The edges of the polygon are (\u003cspan data-scayt_word\u003d\"xi\" data-scaytid\u003d\"14\"\u003exi\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"yi\" data-scaytid\u003d\"15\"\u003eyi\u003c/span\u003e) to (x\u003csub\u003ei+1\u003c/sub\u003e, y\u003csub\u003ei+1\u003c/sub\u003e) for i \u003d 1 . . . n \u0026minus; 1 and (\u003cspan data-scayt_word\u003d\"xn\" data-scaytid\u003d\"11\"\u003exn\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"yn\" data-scaytid\u003d\"13\"\u003eyn\u003c/span\u003e) to (\u003cspan data-scayt_word\u003d\"x1\" data-scaytid\u003d\"5\"\u003ex1\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"y1\" data-scaytid\u003d\"7\"\u003ey1\u003c/span\u003e).\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\r\n\tInput consists of a series of piece \u003cspan data-scayt_word\u003d\"descri_ptions\" data-scaytid\u003d\"16\"\u003edescri_ptions\u003c/span\u003e. Each piece \u003cspan data-scayt_word\u003d\"descri_ption\" data-scaytid\u003d\"17\"\u003edescri_ption\u003c/span\u003e consists of the following data:\u003cbr /\u003e\r\n\tLine 1 \u0026lt; \u003cspan data-scayt_word\u003d\"nVertices\" data-scaytid\u003d\"18\"\u003enVertices\u003c/span\u003e \u0026gt; \u0026lt; \u003cspan data-scayt_word\u003d\"pegRadius\" data-scaytid\u003d\"19\"\u003epegRadius\u003c/span\u003e \u0026gt; \u0026lt; \u003cspan data-scayt_word\u003d\"pegX\" data-scaytid\u003d\"20\"\u003epegX\u003c/span\u003e \u0026gt; \u0026lt; \u003cspan data-scayt_word\u003d\"pegY\" data-scaytid\u003d\"21\"\u003epegY\u003c/span\u003e \u0026gt;\u003cbr /\u003e\r\n\tnumber of vertices in polygon, n (integer)\u003cbr /\u003e\r\n\tradius of peg (real)\u003cbr /\u003e\r\n\tX and Y position of peg (real)\u003cbr /\u003e\r\n\tn Lines \u0026lt; \u003cspan data-scayt_word\u003d\"vertexX\" data-scaytid\u003d\"22\"\u003evertexX\u003c/span\u003e \u0026gt; \u0026lt; \u003cspan data-scayt_word\u003d\"vertexY\" data-scaytid\u003d\"23\"\u003evertexY\u003c/span\u003e \u0026gt;\u003cbr /\u003e\r\n\tOn 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.\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\r\n\tFor each piece \u003cspan data-scayt_word\u003d\"descri_ption\" data-scaytid\u003d\"24\"\u003edescri_ption\u003c/span\u003e, print a single line containing the string:\u003cbr /\u003e\r\n\tHOLE IS ILL-FORMED if the hole contains protrusions\u003cbr /\u003e\r\n\tPEG WILL FIT if the hole contains no protrusions and the peg fits in the hole at the indicated position\u003cbr /\u003e\r\n\tPEG WILL NOT FIT if the hole contains no protrusions but the peg will not fit in the hole at the indicated position\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e\r\n5 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"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e\r\nHOLE IS ILL-FORMED\r\nPEG WILL NOT FIT\u003c/pre\u003e"}}]}