<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b2edcff7f9c46a68aa17f/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b2edcff7f9c46a68aa17f/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">The 2004 28</div><div class="t m0 x2 h2 y2 ff1 fs0 fc0 sc0 ls1 ws1">th</div><div class="t m0 x3 h3 y1 ff1 fs0 fc0 sc0 ls2 ws2"> Annual<span class="fs1 ls3 ws3"> <span class="ff2 ls4 ws1">acm</span> </span><span class="ls5 ws4">International Collegiate<span class="fs2 ls3 ws5"> </span></span></div><div class="t m0 x4 h4 y3 ff2 fs3 fc0 sc0 ls6 ws1">Programmin<span class="_ _0"></span><span class="ls7 ws6">g Contest World Finals<span class="_ _1"></span><span class="ff1 ls3 ws7"> </span></span></div><div class="t m0 x5 h4 y4 ff2 fs4 fc0 sc0 ls8 ws8">sponsored by <span class="_ _2"></span><span class="fs3 ls9 ws1">IBM<span class="ls3 ws7"> </span></span></div><div class="t m0 x6 h5 y5 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y6 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x7 h6 y7 ff1 fs5 fc0 sc0 lsa wsa">Problem A<span class="_ _3"></span><span class="ls3 wsb"> </span></div><div class="t m0 x8 h7 y8 ff1 fs3 fc0 sc0 lsb wsc">Carl the Ant<span class="_ _3"></span><span class="ls3 ws7"> </span></div><div class="t m0 x9 h8 y9 ff1 fs4 fc0 sc0 lsc wsd">Input File: carl.in<span class="ls3 wse"> </span></div><div class="t m0 x6 h5 ya ff3 fs2 fc0 sc0 lsd wsf">Ants leave small chemical trails on the ground in order to mark paths for other ants to follow. Ordinarily these </div><div class="t m0 x6 h5 yb ff3 fs2 fc0 sc0 lse ws10">trails follow rather straight lines. But in one ant colony there is an ant named Carl, and Carl is n<span class="_ _2"></span><span class="lsf ws11">ot an ordinary </span></div><div class="t m0 x6 h5 yc ff3 fs2 fc0 sc0 ls10 ws12">ant. Carl will often zigzag for no apparent reason, sometimes crossing his own path numerous times in the </div><div class="t m0 x6 h5 yd ff3 fs2 fc0 sc0 ls11 ws13">process. When other ants come to an intersection, they always follow the path with the strongest scent, which is </div><div class="t m0 x6 h5 ye ff3 fs2 fc0 sc0 ls12 ws14">the most recent path t<span class="_ _4"> </span><span class="ls13 ws15">hat leads away from the intersection point.<span class="_ _2"></span><span class="ls3 ws9"> </span></span></div><div class="t m0 x6 h5 yf ff3 fs2 fc0 sc0 ls14 ws16">Ants are 1 centimeter long, move <span class="_ _0"></span><span class="ls15 ws17">and burrow <span class="_ _0"></span><span class="ls16 ws18">at 1 centimeter per second, and follow their path<span class="_ _3"></span><span class="ls17 ws1">s<span class="_ _2"></span><span class="ls18 ws19"> exactly (bending </span></span></span></span></div><div class="t m0 x6 h5 y10 ff3 fs2 fc0 sc0 ls19 ws1a">at right angles when moving around corners). Ants cannot cross or overlap each other. If two ants me<span class="_ _2"></span><span class="ls1a ws1b">et at the </span></div><div class="t m0 x6 h5 y11 ff3 fs2 fc0 sc0 ls1b ws1c">exact same instant at an intersection point, the one that has been on Carl’s path the longest has <span class="_ _2"></span><span class="ls1c ws1d">the <span class="_ _0"></span><span class="ls1d ws1e">right of way; </span></span></div><div class="t m0 x6 h5 y12 ff3 fs2 fc0 sc0 ls1e ws1f">otherwise, the ant that has been waiting the longest at an intersection will move first.<span class="_ _2"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y13 ff3 fs2 fc0 sc0 ls1f ws20">Carl burrows up from the ground to start <span class="_ _2"></span><span class="ls20 ws21">at the origin at time 0. He then walks his path and burrows back down </span></div><div class="t m0 x6 h5 y14 ff3 fs2 fc0 sc0 ls21 ws22">into the ground at the endpoint. The rest of the ants follow at regular intervals. Given the description of Carl’s </div><div class="t m0 x6 h5 y15 ff3 fs2 fc0 sc0 ls22 ws23">path and <span class="_ _0"></span><span class="ls23 ws1">when<span class="_ _3"></span><span class="ls24 ws24"> the other ants start the path, you are to determine how l<span class="_ _0"></span><span class="ls25 ws25">ong it takes the entire set of ants to <span class="_ _2"></span><span class="ls26 ws26">finish </span></span></span></span></div><div class="t m0 x6 h5 y16 ff3 fs2 fc0 sc0 ls27 ws1">burrowing<span class="_ _2"></span><span class="ls28 ws27"> back into the ground. All the ants are guaranteed to finish.<span class="_ _0"></span><span class="ls3 ws9"> </span></span></div><div class="t m0 x6 h5 y17 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y18 ff2 fs6 fc0 sc0 ls29 ws1">Input<span class="ls3 ws28"> </span></div><div class="t m0 x6 h5 y19 ff3 fs2 fc0 sc0 ls2a ws29">Input consists of several test cases. The first line of the input file contains a single integer indicating the number </div><div class="t m0 x6 h5 y1a ff3 fs2 fc0 sc0 ls2b ws2a">of test cases<span class="_ _1"> </span><span class="ls2c ws1">.<span class="ls3 ws9"> </span></span></div><div class="t m0 x6 h5 y1b ff3 fs2 fc0 sc0 ls2d ws2b">The input for each test case starts with a single line containing three positive integers <span class="_ _2"></span><span class="ff4 ls2e ws1">n<span class="ls3 ws9"> </span><span class="ff3 ls2f">(1<span class="_ _3"></span><span class="ls3 ws9"> <span class="_ _0"></span><span class="ls30 ws1">=</span><span class="ff4"> <span class="ls2e ws1">n</span> </span><span class="ls30 ws1">=</span> <span class="ls31 ws1">50),<span class="_ _2"></span><span class="ff4 ls3 ws9"> </span></span></span></span></span></div><div class="t m0 x6 h5 y1c ff4 fs2 fc0 sc0 ls32 ws1">m<span class="ff3 ls3 ws9"> <span class="ls33 ws1">(1</span> <span class="ls30 ws1">=</span><span class="ff4"> </span></span>m<span class="ls3 ws9"> </span><span class="ff3 ls30">=<span class="ls3 ws9"> <span class="ls34 ws2c">100), and <span class="_ _0"></span></span></span></span><span class="ls2e">d<span class="_ _2"></span><span class="ls3 ws9"> <span class="_ _0"></span><span class="ff3 ls2f ws1">(1<span class="_ _2"></span><span class="ls3 ws9"> <span class="_ _2"></span><span class="ls30 ws1">=<span class="_ _0"></span><span class="ff4 ls3 ws9"> <span class="ls2e ws1">d</span> </span>=<span class="ls3 ws9"> </span><span class="ls35">100)<span class="ff4 ls2c">. <span class="_ _2"></span><span class="ff3 ls36">Here,<span class="_ _2"></span><span class="ff4 ls2e ws2d"> n<span class="ff3 ls37 ws2e"> is the number of line segments in Carl’s path, <span class="_ _2"></span><span class="ff4 ls32 ws1">m<span class="_ _0"></span><span class="ff3 ls38 ws2f"> is the number of </span></span></span></span></span></span></span></span></span></span></span></span></div><div class="t m0 x6 h5 y1d ff3 fs2 fc0 sc0 ls39 ws30">ants traveling the path (including C<span class="ls3a ws31">arl), and <span class="ff4 ls2e ws1">d</span><span class="ls3b ws32"> is the time delay before each successive ant’s emergence. Carl </span></span></div><div class="t m0 x6 h5 y1e ff3 fs2 fc0 sc0 ls3c ws33">(who is numbered 0) starts at time 0. The next ant (ant number 1) will emerge at time <span class="ff4 ls3d ws1">d,<span class="_ _0"></span></span><span class="ls2d ws34"> the next at time 2<span class="_ _0"></span><span class="ff4 ls3e ws1">d,<span class="_"> </span></span><span class="ls3f ws35"> and </span></span></div><div class="t m0 x6 h5 y1f ff3 fs2 fc0 sc0 ls26 ws36">so on. If the burrow is blocked, the ants will emerge as soon as po<span class="ls40 ws37">ssible in the correct order.<span class="_ _2"></span><span class="ls3 ws9"> </span></span></div><div class="t m0 x6 h5 y20 ff3 fs2 fc0 sc0 lse ws38">Each of the next <span class="_ _2"></span><span class="ff4 ls2e ws1">n<span class="ff3 ls41 ws39"> lines for the test case consists of a unique integer pair <span class="_ _0"></span></span><span class="ls42 ws3a">x y<span class="_ _2"></span><span class="ff3 ls43 ws3b"> (<span class="_ _3"></span><span class="ls44 ws1">-<span class="_ _0"></span><span class="ls45">100<span class="_ _4"> </span><span class="ls3 ws9"> </span><span class="ls30">=<span class="_ _2"></span><span class="ff4 ls3 ws9"> <span class="_ _0"></span><span class="ls46 ws1">x,<span class="_ _3"></span><span class="ls3 ws9"> <span class="_ _0"></span><span class="ls42 ws1">y</span> <span class="_ _0"></span><span class="ff3 ls30 ws1">=<span class="_ _2"></span><span class="ls3 ws9"> <span class="_ _0"></span><span class="ls47 ws3c">100), which is the </span></span></span></span></span></span></span></span></span></span></span></span></div><div class="t m0 x6 h5 y21 ff3 fs2 fc0 sc0 ls48 ws3d">endpoint of a line segment of Carl’s path, in the order that Carl travels. The first line starts at the origin (0,0) and </div><div class="t m0 x6 h5 y22 ff3 fs2 fc0 sc0 ls49 ws3e">the starting point of every <span class="ls4a ws1">subsequent<span class="_ _0"></span><span class="ls4b ws3f"> line is the endpoint of the previous line.<span class="ls3 ws9"> </span></span></span></div><div class="t m0 x6 h5 y23 ff3 fs2 fc0 sc0 ls4c ws40">For simplicity, Carl alwa<span class="_ _2"></span><span class="ls4d ws41">ys travels on line segments parall<span class="ls4e ws42">el to the axes, and no endpoints<span class="_ _0"></span><span class="ls4f ws43"> lie on any segment </span></span></span></div><div class="t m0 x6 h5 y24 ff3 fs2 fc0 sc0 ls50 ws44">other than the ones which they serve as an endpoint.<span class="_ _2"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y25 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y26 ff2 fs6 fc0 sc0 ls51 ws1">Output<span class="ls3 ws28"> </span></div><div class="t m0 x6 h5 y27 ff3 fs2 fc0 sc0 ls52 ws45">The output for each case is described as follows:<span class="_ _2"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y28 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 ha y29 ff5 fs2 fc0 sc0 ls53 ws46">Case C:<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y2a ff5 fs2 fc0 sc0 ls54 ws48">Carl finished the path at time t1<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y2b ff5 fs2 fc0 sc0 ls55 ws49">The ants finishe<span class="_ _2"></span><span class="ls56 ws4a">d in the following order:<span class="_ _0"></span><span class="ls3 ws47"> </span></span></div><div class="t m0 x6 ha y2c ff5 fs2 fc0 sc0 ls57 ws4b">a1 a2 a3 ... am<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y2d ff5 fs2 fc0 sc0 ls58 ws4c">The last ant finished the path at time t2<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 h5 y2e ff3 fs2 fc0 sc0 ls59 ws4d">Here, <span class="_ _2"></span><span class="ff5 ls5a ws1">C<span class="_ _0"></span><span class="ff3 ls5b ws4e"> is the case number (starting at 1), <span class="_ _2"></span><span class="ff5 ls5c ws1">a1<span class="_ _2"></span><span class="ff3 ls2c">,<span class="ff5 ls5c ws4f"> a2<span class="_ _2"></span><span class="ff3 ls2c ws1">,<span class="ff5 ls5a ws50"> a3<span class="_ _4"> </span></span><span class="ls5d ws51">, … <span class="_ _2"></span><span class="ff5 ls5c ws1">am<span class="_ _2"></span><span class="ff3 ls5e ws52"> are the ant numbers in the order that they go </span></span></span></span></span></span></span></span></span></div><div class="t m0 x6 h5 y2f ff3 fs2 fc0 sc0 ls5f ws53">back underground, and <span class="_ _0"></span><span class="ff5 ls5c ws1">t1<span class="_ _2"></span><span class="ff3 ls3f ws54"> and <span class="ff5 ls5a ws1">t2<span class="_ _0"></span></span><span class="ls60 ws55"> are the times (in seconds) at whi<span class="ls61 ws56">ch Carl and the last ant finish going </span></span></span></span></div><div class="t m0 x6 h5 y30 ff3 fs2 fc0 sc0 ls62 ws1">underground.<span class="_ _0"></span><span class="ls3 ws9"> <span class="_ _2"></span><span class="ls63 ws57">You should separate consecutive cases with a single blank line.<span class="ls3 ws9"> </span></span></span></div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>
</body>
</html>
<div id="pf2" class="pf w0 h0" data-page-no="2"><div class="pc pc2 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b2edcff7f9c46a68aa17f/bg2.jpg"><div class="t m0 xa h9 y31 ff2 fs2 fc0 sc0 ls64 ws58">The 2004<span class="_ _4"></span><span class="fs6 ls65 ws59"> ACM Programming Contest World Finals sponsored by IBM</span><span class="ff1 ls3 ws5"> </span></div><div class="t m0 x6 h5 y32 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y33 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y34 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y35 ff2 fs6 fc0 sc0 ls66 ws5a">Sample Input<span class="ls3 ws28"> <span class="_ _5"> </span><span class="ls67 ws5b">Output for the Sample Input</span> </span></div><div class="t m0 x6 ha y36 ff5 fs2 fc0 sc0 ls5a ws1">2<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y37 ff5 fs2 fc0 sc0 ls68 ws5c">4 7 4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y38 ff5 fs2 fc0 sc0 ls69 ws5d">0 4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y39 ff5 fs2 fc0 sc0 ls69 ws5d">2 4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y3a ff5 fs2 fc0 sc0 ls69 ws5d">2 2<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y3b ff5 fs2 fc0 sc0 ls5a ws1">-<span class="_ _0"></span><span class="ls69 ws5e">2 2<span class="_ _2"></span><span class="ls3 ws47"> </span></span></div><div class="t m0 x6 ha y3c ff5 fs2 fc0 sc0 ls68 ws5c">4 7 2<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y3d ff5 fs2 fc0 sc0 ls69 ws5d">0 4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y3e ff5 fs2 fc0 sc0 ls69 ws5d">2 4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y3f ff5 fs2 fc0 sc0 ls69 ws5d">2 2<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha ya ff5 fs2 fc0 sc0 ls5a ws1">-<span class="_ _0"></span><span class="ls69 ws5e">2 2<span class="_ _2"></span><span class="ls3 ws47"> </span></span></div><div class="t m0 xb ha y36 ff5 fs2 fc0 sc0 ls53 ws46">Case 1:<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y37 ff5 fs2 fc0 sc0 ls54 ws48">Carl finished the path at time 13<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y38 ff5 fs2 fc0 sc0 ls6a ws5f">The an<span class="_ _2"></span><span class="ls6b ws60">ts finished in the following order:<span class="_ _0"></span><span class="ls3 ws47"> </span></span></div><div class="t m0 xb ha y39 ff5 fs2 fc0 sc0 ls6c ws61">0 2 1 3 4 5 6<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y3a ff5 fs2 fc0 sc0 ls58 ws4c">The last ant finished the path at time 29<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y3b ff5 fs2 fc0 sc0 ls3 ws47"> </div><div class="t m0 xb ha y3c ff5 fs2 fc0 sc0 ls53 ws46">Case 2:<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y3d ff5 fs2 fc0 sc0 ls54 ws48">Carl finished the path at time 13<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y3e ff5 fs2 fc0 sc0 ls6d ws62">The ants finished in the following order:<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha y3f ff5 fs2 fc0 sc0 ls6c ws61">0 4 1 5 2 6 3<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 xb ha ya ff5 fs2 fc0 sc0 ls6e ws63">The last ant finished the path at time 19 <span class="_ _2"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 h5 yb ff3 fs2 fc0 sc0 ls3 ws9"> </div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>
<div id="pf3" class="pf w0 h0" data-page-no="3"><div class="pc pc3 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b2edcff7f9c46a68aa17f/bg3.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">The 2004 28</div><div class="t m0 x2 h2 y2 ff1 fs0 fc0 sc0 ls1 ws1">th</div><div class="t m0 x3 h3 y1 ff1 fs0 fc0 sc0 ls2 ws2"> Annual<span class="fs1 ls3 ws3"> <span class="ff2 ls4 ws1">acm</span> </span><span class="ls5 ws4">International Collegiate<span class="fs2 ls3 ws5"> </span></span></div><div class="t m0 x4 h4 y3 ff2 fs3 fc0 sc0 ls6 ws1">Programmin<span class="_ _0"></span><span class="ls7 ws6">g Contest World Finals<span class="_ _1"></span><span class="ff1 ls3 ws7"> </span></span></div><div class="t m0 x5 h4 y4 ff2 fs4 fc0 sc0 ls8 ws8">sponsored by <span class="_ _2"></span><span class="fs3 ls9 ws1">IBM<span class="ls3 ws7"> </span></span></div><div class="t m0 x6 h5 y5 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y6 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xc h6 y7 ff1 fs5 fc0 sc0 lsa wsa">Problem B<span class="_ _2"></span><span class="ls3 wsb"> </span></div><div class="t m0 xd h7 y8 ff1 fs3 fc0 sc0 ls6f ws1">Heliport<span class="_ _2"></span><span class="ls3 ws7"> </span></div><div class="t m0 xe h8 y9 ff1 fs4 fc0 sc0 ls70 ws64">Input File: heliport.in<span class="ls3 wse"> </span></div><div class="t m0 x6 h5 y40 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 yb ff3 fs2 fc0 sc0 ls71 ws65">In these fast<span class="_ _0"></span><span class="ls44 ws1">-<span class="ls72 ws66">paced times, companies are investing in heliports to reduce travel time for their busy executives. </span></span></div><div class="t m0 x6 h5 yc ff3 fs2 fc0 sc0 ls73 ws67">The heliports are typically circular landing pads, constructed on the roofs of the companies’ headquarters.<span class="_ _2"></span><span class="ls3 ws9"> </span></div><div class="t m0 xf h5 y41 ff3 fs2 fc0 sc0 ls74 ws68">You must <span class="ls75 ws69">write a program that finds the largest radius for a circular </span></div><div class="t m0 xf h5 y42 ff3 fs2 fc0 sc0 ls76 ws6a">heliport that can be constructed on the flat roof of a building that is in the </div><div class="t m0 xf h5 yf ff3 fs2 fc0 sc0 ls77 ws6b">form of a <span class="_ _2"></span><span class="ls78 ws1">simple<span class="_ _3"></span><span class="ls79 ws6c"> polygon. Since this is merely the design phase of the </span></span></div><div class="t m0 xf h5 y10 ff3 fs2 fc0 sc0 ls7a ws6d">construction effort, your program must find o<span class="_ _2"></span><span class="ls7b ws6e">nly the radius of the heliport. </span></div><div class="t m0 xf h5 y11 ff3 fs2 fc0 sc0 ls7c ws6f">The maximum radius for a heliport in the diagram shown is 10.<span class="ls3 ws9"> </span></div><div class="t m0 xf h5 y12 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xf h5 y43 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xf h5 y44 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xf h5 y45 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xf h5 y46 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 xf h5 y47 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y48 ff2 fs6 fc0 sc0 ls7d ws70">Input File<span class="_ _4"></span><span class="ls3 ws28"> </span></div><div class="t m0 x6 h5 y49 ff3 fs2 fc0 sc0 ls7e ws71">The input file contains several test cases. Each test case consists of two lines. The first line consists of an even </div><div class="t m0 x6 h5 y4a ff3 fs2 fc0 sc0 ls7f ws72">integer <span class="_ _0"></span><span class="ff4 ls2e ws1">n<span class="_ _2"></span><span class="ff3 ls33 ws73"> (4 <span class="ls30 ws74">= <span class="ff4 ls2e ws1">n</span><span class="ls3 ws9"> <span class="_ _0"></span><span class="ls80 ws75">= 20), whic<span class="_ _2"></span><span class="ls81 ws76">h is the number of the sides of the building. The second line consists of <span class="_ _2"></span><span class="ff4 ls2e ws1">n<span class="_ _0"></span><span class="ff3 ls82 ws77"> pairs of the </span></span></span></span></span></span></span></span></div><div class="t m0 x6 h5 y4b ff3 fs2 fc0 sc0 ls83 ws78">form (<span class="_ _2"></span><span class="ff4 ls84 ws79">m, d<span class="_ _2"></span><span class="ff3 ls50 ws7a">), where <span class="_ _2"></span><span class="ff4 ls32 ws1">m<span class="ff3 ls85 ws7b"> is an integer (1<span class="_ _0"></span><span class="ls86 ws74">= <span class="_ _0"></span></span></span>m<span class="_ _0"></span><span class="ff3 ls3 ws9"> <span class="_ _2"></span><span class="ls87 ws7c">= 50) and <span class="_ _4"> </span><span class="ff4 ls2e ws1">d</span><span class="ls88 ws7d"> is a letter (U, R, D, L). Assuming the roof is drawn on the </span></span></span></span></span></span></div><div class="t m0 x6 h5 y4c ff3 fs2 fc0 sc0 ls89 ws7e">Cartesian plane, <span class="ff4 ls32 ws1">m</span><span class="ls8a ws7f"> is the length of a roof boundary se<span class="_ _3"></span><span class="ls73 ws80">gment and <span class="_ _0"></span><span class="ff4 ls2e ws1">d<span class="_ _2"></span><span class="ff3 ls8b ws81"> is the direction of tha<span class="ls8c ws82">t segment as you travel </span></span></span></span></span></div><div class="t m0 x6 h5 y4d ff3 fs2 fc0 sc0 ls8d ws1">counter<span class="_ _0"></span><span class="ls8e ws83">clockwise around the roof. U,<span class="_ _2"></span><span class="ls8f ws84"> R, D, and L mean “Up,” “Right,”<span class="_ _3"></span><span class="ls90 ws85"> “Down,” and “Left” respectively. The </span></span></span></div><div class="t m0 x6 h5 y1d ff3 fs2 fc0 sc0 ls91 ws86">boundary segments of the roof, which are parallel to the <span class="_ _4"> </span><span class="ff4 ls42 ws1">x</span><span class="ls92 ws87"> and <span class="_ _0"></span><span class="ff4 ls42 ws1">y</span><span class="ls93 ws88"> axes, <span class="_ _0"></span><span class="ls22 ws89">are given in counter<span class="_ _0"></span><span class="ls94 ws8a">clockwise order. The </span></span></span></span></div><div class="t m0 x6 h5 y4e ff3 fs2 fc0 sc0 ls95 ws8b">starting position is the origin (0, 0).<span class="_ _0"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y4f ff3 fs2 fc0 sc0 ls96 ws8c">Input for the last test case is followed by a line consisting of the number 0.<span class="_ _0"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y20 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y50 ff2 fs6 fc0 sc0 ls97 ws8d">Output File<span class="_"> </span><span class="ls3 ws28"> </span></div><div class="t m0 x6 h5 y51 ff3 fs2 fc0 sc0 ls98 ws8e">For each test case, the output consists of a separate line containing the case number (starting with 1)<span class="_ _0"></span><span class="ls99 ws8f"> and a real </span></div><div class="t m0 x6 h5 y52 ff3 fs2 fc0 sc0 ls9a ws90">number (rounded to two digits after the decimal point) representing the radius of the heliport. Print a blank line </div><div class="t m0 x6 h5 y53 ff3 fs2 fc0 sc0 ls9b ws91">between cases as shown in the sample output.<span class="_ _2"></span><span class="ls3 ws9"> </span></div><div class="t m0 x6 h5 y54 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y55 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y56 ff2 fs6 fc0 sc0 ls66 ws5a">Sample Input<span class="ls3 ws28"> </span></div><div class="t m0 x6 ha y28 ff5 fs2 fc0 sc0 ls5a ws1">4<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y57 ff5 fs2 fc0 sc0 ls9c ws92">2 R 2 U 2 L 2 D<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y58 ff5 fs2 fc0 sc0 ls5c ws1">10<span class="_ _2"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 ha y59 ff5 fs2 fc0 sc0 ls9d ws93">10 R 10 U 10 L 10 U 10 R 5 U 30 L 20 D 20 R 5 D</div><div class="c x10 y5a w2 hb"><div class="t m0 x0 ha y5b ff5 fs2 fc0 sc0 ls3 ws47"> </div></div><div class="t m0 x6 ha y5c ff5 fs2 fc0 sc0 ls5a ws1">0<span class="_ _0"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 h5 y5d ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h9 y5e ff2 fs6 fc0 sc0 ls89 ws94">Output for the Sample Input<span class="ls3 ws28"> </span></div><div class="t m0 x6 ha y5f ff5 fs2 fc0 sc0 ls9e ws95">Case Number 1 radius is<span class="_ _0"></span><span class="ls5a ws1">:<span class="ls9f ws96"> 1.00<span class="_ _0"></span><span class="ls3 ws47"> </span></span></span></div><div class="t m0 x6 ha y60 ff5 fs2 fc0 sc0 ls3 ws47"> </div><div class="t m0 x6 ha y61 ff5 fs2 fc0 sc0 lsa0 ws97">Case Number 2 radius is: 10.00<span class="_ _2"></span><span class="ls3 ws47"> </span></div><div class="t m0 x6 h5 y62 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x11 hc y63 ff3 fs7 fc0 sc0 lsa1 ws1">25<span class="_ _2"></span><span class="ls3 ws98"> </span></div><div class="t m0 x12 hc y15 ff3 fs7 fc0 sc0 lsa2 ws99">20 0 10<span class="ls3 ws98"> </span></div><div class="t m0 x13 hc y64 ff3 fs7 fc0 sc0 lsa1 ws1">5</div><div class="c x14 y44 w3 hd"><div class="t m0 x0 hc y65 ff3 fs7 fc0 sc0 ls3 ws98"> </div></div><div class="t m0 x15 hc y66 ff3 fs7 fc0 sc0 lsa1 ws1">10<span class="_ _2"></span><span class="ls3 ws98"> </span></div><div class="t m0 x11 hc y67 ff3 fs7 fc0 sc0 lsa1 ws1">20<span class="_ _2"></span><span class="ls3 ws98"> </span></div><div class="t m0 x16 hc y68 ff3 fs7 fc1 sc0 lsa3 ws1">Y</div><div class="c x17 y69 w4 hd"><div class="t m0 x0 hc y65 ff3 fs7 fc1 sc0 ls3 ws98"> </div></div><div class="t m0 x18 hc y6a ff3 fs7 fc1 sc0 lsa3 ws1">X</div><div class="c x19 y6b w3 hd"><div class="t m0 x0 hc y65 ff3 fs7 fc1 sc0 ls3 ws98"> </div></div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>
<div id="pf4" class="pf w0 h0" data-page-no="4"><div class="pc pc4 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b2edcff7f9c46a68aa17f/bg4.jpg"><div class="t m0 xa h9 y31 ff2 fs2 fc0 sc0 ls64 ws58">The 2004<span class="_ _4"></span><span class="fs6 ls65 ws59"> ACM Programming Contest World Finals sponsored by IBM</span><span class="ff1 ls3 ws5"> </span></div><div class="t m0 x6 h5 y32 ff3 fs2 fc0 sc0 ls3 ws9"> </div><div class="t m0 x6 h5 y33 ff3 fs2 fc0 sc0 ls3 ws9"> </div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>