{"raw_statement":[{"iden":"statement","content":"Polycarp continues to play with lamps. Today he illuminates cylinder with N lamps. Center of cylinder's bottom in (xc, yc, 0), height is h, radius is r. Bottom belongs to xOy plane, top is parallel to bottom and its center is (xc, yc, h). Polycarp prepares N lamps, i-th lamp situates in (xi, yi, zi) point. The size of lamps is enough small to neglect it. Lamps enough powerfull to lighten any point in the space, if there are no obstacles. Cylinder absolutely opaque. Polycarp wants to find illuminated area of cylinder. \n\nThe first line contains four integer numbers: xc, yc, h, r, where xc, yc are coordinates of bottom's center, h is height and r is radius. The second line contains one integer number: N. Next N lines contains three integers: xi, yi, zi, these are coordinates of i-th lamp.\n\nAll coordinates are greater than  - 1001 and less than 1001. 1 ≤ h, r ≤ 1000. 1 ≤ N ≤ 100. There are no lamps in the cylinder and no lamps on cylinder's sides. In one point can be only one lamp.\n\nOutput the square of illuminated area of cylinder. You may assume that answers is coparated with the precision of 10 - 6. \n\nA Lamp illuminates bottom only if its z coordinate less than 0, and top if greats h. If a lamp in the plane of bottom it does not illuminate them, same situation with top.\n\n"},{"iden":"input","content":"The first line contains four integer numbers: xc, yc, h, r, where xc, yc are coordinates of bottom's center, h is height and r is radius. The second line contains one integer number: N. Next N lines contains three integers: xi, yi, zi, these are coordinates of i-th lamp.All coordinates are greater than  - 1001 and less than 1001. 1 ≤ h, r ≤ 1000. 1 ≤ N ≤ 100. There are no lamps in the cylinder and no lamps on cylinder's sides. In one point can be only one lamp."},{"iden":"output","content":"Output the square of illuminated area of cylinder. You may assume that answers is coparated with the precision of 10 - 6. "},{"iden":"examples","content":"Input0 0 10 1010 0 100Output314.15926536Input0 0 10 104-100 0 -1000 -100 -25100 0 250 100 100Output1256.63706144"},{"iden":"note","content":"A Lamp illuminates bottom only if its z coordinate less than 0, and top if greats h. If a lamp in the plane of bottom it does not illuminate them, same situation with top."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ C $ be a right circular cylinder defined by:  \n- Bottom center: $ (x_c, y_c, 0) $,  \n- Top center: $ (x_c, y_c, h) $,  \n- Radius: $ r $,  \n- Height: $ h $.  \n\nLet $ L = \\{ (x_i, y_i, z_i) \\mid i \\in \\{1, \\dots, N\\} \\} $ be the set of $ N $ lamp positions, with $ z_i \\neq 0 $ and $ z_i \\neq h $, and no lamp lies on or inside the cylinder surface.\n\n**Constraints**  \n1. $ -1001 < x_c, y_c, x_i, y_i, z_i < 1001 $  \n2. $ 1 \\leq h, r \\leq 1000 $  \n3. $ 1 \\leq N \\leq 100 $  \n4. All lamps are exterior to the cylinder and not on its lateral or top/bottom surfaces.  \n\n**Objective**  \nCompute the total illuminated area on the cylinder’s **bottom** ($ z=0 $) and **top** ($ z=h $) disks, excluding the lateral surface.  \n\nA lamp at $ (x_i, y_i, z_i) $ illuminates:  \n- The **bottom disk** ($ z=0 $) **iff** $ z_i < 0 $, and the ray from the lamp to a point on the bottom disk does not intersect the cylinder’s lateral surface.  \n- The **top disk** ($ z=h $) **iff** $ z_i > h $, and the ray from the lamp to a point on the top disk does not intersect the cylinder’s lateral surface.  \n\nThe illuminated area is the union of all points on the bottom and top disks that are visible from at least one lamp (i.e., not occluded by the cylinder).  \n\nLet $ A_{\\text{bottom}} \\subseteq \\{ (x, y, 0) \\mid (x - x_c)^2 + (y - y_c)^2 \\leq r^2 \\} $ be the set of illuminated points on the bottom.  \nLet $ A_{\\text{top}} \\subseteq \\{ (x, y, h) \\mid (x - x_c)^2 + (y - y_c)^2 \\leq r^2 \\} $ be the set of illuminated points on the top.  \n\nCompute:  \n$$\n\\text{Area} = \\text{Area}(A_{\\text{bottom}}) + \\text{Area}(A_{\\text{top}})\n$$","simple_statement":"A cylinder has center at (xc, yc, 0), height h, radius r.  \nN lamps are placed at points (xi, yi, zi).  \nThe cylinder is opaque — light cannot pass through it.  \nLamps light up parts of the cylinder’s surface if unobstructed.  \nFind the total illuminated area on the cylinder’s side surface (not top or bottom).  \nLamps below z=0 or above z=h do not light the bottom or top.  \nOutput the area with precision 1e-6.","has_page_source":false}