{"raw_statement":[{"iden":"statement","content":"Consider a house plan.\n\nLet the house be represented by an infinite horizontal strip defined by the inequality  - _h_ ≤ _y_ ≤ _h_. Strictly outside the house there are two light sources at the points (0, _f_) and (0,  - _f_). Windows are located in the walls, the windows are represented by segments on the lines _y_ = _h_ and _y_ =  - _h_. Also, the windows are arranged symmetrically about the line _y_ = 0.\n\nYour task is to find the area of the floor at the home, which will be lighted by the sources of light.\n\n<center>![image](https://espresso.codeforces.com/ee5b0785282dc1792169f0fd75524276e6bb12ee.png)</center>"},{"iden":"input","content":"The first line of the input file contains three integers _n_, _h_ and _f_ (1 ≤ _n_ ≤ 500, 1 ≤ _h_ ≤ 10, _h_ < _f_ ≤ 1000). Next, _n_ lines contain two integers each _l__i_, _r__i_ ( - 5000 ≤ _l__i_ < _r__i_ ≤ 5000), each entry indicates two segments. Endpoints of the first segment are (_l__i_, _h_)\\-(_r__i_, _h_), and endpoints of the second segment are (_l__i_,  - _h_)\\-(_r__i_,  - _h_). These segments describe location of windows. Numbers in the lines are space-separated. It is guaranteed that no two distinct segments have common points."},{"iden":"output","content":"Print the single real number — the area of the illuminated part of the floor with an absolute or relative error of no more than 10 - 4."},{"iden":"examples","content":"Input\n\n1 1 2\n-1 1\n\nOutput\n\n10.0000000000\n\nInput\n\n2 2 4\n-1 0\n1 2\n\nOutput\n\n23.3333333333"},{"iden":"note","content":"The second sample test is shown on the figure. Green area is the desired area of the illuminated part of the floor. Violet segments indicate windows."}],"translated_statement":[{"iden":"statement","content":"考虑一个房屋平面图。\n\n设房屋由不等式 $-h \\leq y \\leq h$ 定义的无限水平条带表示。在房屋外部严格之外，有两个光源位于点 $(0, f)$ 和 $(0, -f)$。窗户位于墙壁上，窗户由位于直线 $y = h$ 和 $y = -h$ 上的线段表示。此外，窗户关于直线 $y = 0$ 对称排列。\n\n你的任务是求出房屋地板上被光源照亮的区域面积。\n\n输入文件的第一行包含三个整数 $n$、$h$ 和 $f$（$1 \\leq n \\leq 500$，$1 \\leq h \\leq 10$，$h < f \\leq 1000$）。接下来的 $n$ 行每行包含两个整数 $l_i$、$r_i$（$-5000 \\leq l_i < r_i \\leq 5000$），每条记录表示两个线段。第一个线段的端点为 $(l_i, h)$ 到 $(r_i, h)$，第二个线段的端点为 $(l_i, -h)$ 到 $(r_i, -h)$。这些线段描述了窗户的位置。行中的数字以空格分隔。保证任意两个不同的线段没有公共点。\n\n输出一个实数——被照亮的地板部分的面积，绝对误差或相对误差不超过 $10^{-4}$。\n\n第二个样例测试如图所示。绿色区域为所求的被照亮地板面积。紫色线段表示窗户。\n\n"},{"iden":"input","content":"输入文件的第一行包含三个整数 $n$、$h$ 和 $f$（$1 \\leq n \\leq 500$，$1 \\leq h \\leq 10$，$h < f \\leq 1000$）。接下来的 $n$ 行每行包含两个整数 $l_i$、$r_i$（$-5000 \\leq l_i < r_i \\leq 5000$），每条记录表示两个线段。第一个线段的端点为 $(l_i, h)$ 到 $(r_i, h)$，第二个线段的端点为 $(l_i, -h)$ 到 $(r_i, -h)$。这些线段描述了窗户的位置。行中的数字以空格分隔。保证任意两个不同的线段没有公共点。 "},{"iden":"output","content":"输出一个实数——被照亮的地板部分的面积，绝对误差或相对误差不超过 $10^{-4}$。"},{"iden":"examples","content":"输入\n1 1 2\n-1 1\n输出\n10.0000000000\n\n输入\n2 2 4\n-1 0\n1 2\n输出\n23.3333333333"},{"iden":"note","content":"第二个样例测试如图所示。绿色区域为所求的被照亮地板面积。紫色线段表示窗户。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, h, f \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 500 $, $ 1 \\leq h \\leq 10 $, $ h < f \\leq 1000 $.  \nLet $ W = \\{ (l_i, r_i) \\mid i \\in \\{1, \\dots, n\\} \\} $ be a set of $ n $ intervals, each defining a window segment on both top and bottom walls:  \n- Top window: segment from $ (l_i, h) $ to $ (r_i, h) $  \n- Bottom window: segment from $ (l_i, -h) $ to $ (r_i, -h) $  \n\nTwo point light sources are located at $ (0, f) $ and $ (0, -f) $.  \nThe house is the infinite horizontal strip $ \\mathcal{H} = \\{ (x, y) \\in \\mathbb{R}^2 \\mid -h \\leq y \\leq h \\} $.  \n\n**Constraints**  \n1. All $ l_i, r_i \\in \\mathbb{Z} $, $ -5000 \\leq l_i < r_i \\leq 5000 $  \n2. For all $ i \\neq j $, intervals $ (l_i, r_i) $ and $ (l_j, r_j) $ are disjoint  \n3. $ h < f $  \n\n**Objective**  \nCompute the area of the region $ \\mathcal{I} \\subseteq \\mathcal{H} $ illuminated by at least one of the two light sources, where illumination occurs via rays passing through the windows.  \n\nThe illuminated region $ \\mathcal{I} $ is the union of:  \n- The region illuminated by source $ (0, f) $ through the top windows:  \n  $$\n  \\mathcal{I}_+ = \\bigcup_{i=1}^n \\left\\{ (x, y) \\in \\mathcal{H} \\mid \\exists t \\in [0,1], \\; (x, y) = (1-t)(l_i, h) + t(0, f) \\text{ or } (x, y) = (1-t)(r_i, h) + t(0, f) \\right\\}\n  $$  \n  (i.e., the convex hull of $ (l_i, h), (r_i, h), (0, f) $ intersected with $ \\mathcal{H} $)  \n\n- The region illuminated by source $ (0, -f) $ through the bottom windows:  \n  $$\n  \\mathcal{I}_- = \\bigcup_{i=1}^n \\left\\{ (x, y) \\in \\mathcal{H} \\mid \\exists t \\in [0,1], \\; (x, y) = (1-t)(l_i, -h) + t(0, -f) \\text{ or } (x, y) = (1-t)(r_i, -h) + t(0, -f) \\right\\}\n  $$  \n\nThen:  \n$$\n\\mathcal{I} = \\mathcal{I}_+ \\cup \\mathcal{I}_-\n$$\n\nCompute the area:  \n$$\n\\text{Area} = \\iint_{\\mathcal{I}} dx\\,dy\n$$","simple_statement":null,"has_page_source":false}