Problem: Consider a house plan. 

Let 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.

Your task is to find the area of the floor at the home, which will be lighted by the sources of light. 

<image>

Input

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 li, ri ( - 5000 ≤ li < ri ≤ 5000), each entry indicates two segments. Endpoints of the first segment are (li, h)-(ri, h), and endpoints of the second segment are (li, - h)-(ri, - 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. 

Output

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.

Examples

Input

1 1 2
-1 1


Output

10.0000000000


Input

2 2 4
-1 0
1 2


Output

23.3333333333

Note

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.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
inline void read(int &n) {
  char c;
  for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar())
    ;
  n = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int N, L[1000], R[1000];
double ans, H, F;
struct point {
  double x, y;
  bool ava;
  point() {}
  point(double _x, double _y) : x(_x), y(_y) { ava = 0; }
};
struct line {
  double k, b;
  bool stt;
};
double gabs(double x) { return (x > 0) ? x : -x; }
double cross(point a, point b, point c) {
  return (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x);
}
double cal(point a, point b, point c) { return gabs(cross(a, b, c)) / 2; }
line gen_line(point A, point B) {
  line ans;
  if (A.x == B.x)
    ans.stt = 1;
  else {
    ans.k = (B.y - A.y) / (B.x - A.x);
    ans.b = A.y - A.x * ans.k;
    ans.stt = 0;
  }
  return ans;
}
point cross_point(line A, line B) {
  point ans;
  if (B.stt == 1)
    return point(0, A.b);
  else if (A.stt == 1)
    return point(0, B.b);
  else {
    if (B.k == A.k) {
      ans.ava = 1;
      return ans;
    }
    ans.x = (A.b - B.b) / (B.k - A.k);
    ans.y = ans.x * A.k + A.b;
    ans.ava = 0;
    return ans;
  }
}
bool inside(double x, double L, double R) {
  if (L > R) swap(L, R);
  return x >= L && x <= R;
}
double cal_com(int L1, int R1, int L2, int R2) {
  double ans;
  vector<point> A, B;
  A.clear();
  A.push_back(point(-1e15, H));
  A.push_back(point(1e15, H));
  A.push_back(point(1e15, -H));
  A.push_back(point(-1e15, -H));
  B.clear();
  for (int i = 0; i < A.size(); ++i)
    if (cross(A[i], point(L1, -H), point(0, -F)) >= 0)
      B.push_back(A[i]);
    else {
      point pre, nxt;
      if (i + 1 < A.size())
        nxt = A[i + 1];
      else
        nxt = A[0];
      if (i - 1 >= 0)
        pre = A[i - 1];
      else
        pre = A[A.size() - 1];
      point c1 = cross_point(gen_line(A[i], pre),
                             gen_line(point(0, -F), point(L1, -H)));
      point c2 = cross_point(gen_line(A[i], nxt),
                             gen_line(point(0, -F), point(L1, -H)));
      if (!c1.ava && inside(c1.x, A[i].x, pre.x) && inside(c1.y, A[i].y, pre.y))
        B.push_back(c1);
      if (!c2.ava && inside(c2.x, A[i].x, nxt.x) && inside(c2.y, A[i].y, nxt.y))
        B.push_back(c2);
    }
  A = B;
  B.clear();
  for (int i = 0; i < A.size(); ++i)
    if (cross(A[i], point(R1, -H), point(0, -F)) <= 0)
      B.push_back(A[i]);
    else {
      point pre, nxt;
      if (i + 1 < A.size())
        nxt = A[i + 1];
      else
        nxt = A[0];
      if (i - 1 >= 0)
        pre = A[i - 1];
      else
        pre = A[A.size() - 1];
      point c1 = cross_point(gen_line(A[i], pre),
                             gen_line(point(0, -F), point(R1, -H)));
      point c2 = cross_point(gen_line(A[i], nxt),
                             gen_line(point(0, -F), point(R1, -H)));
      if (!c1.ava && inside(c1.x, A[i].x, pre.x) && inside(c1.y, A[i].y, pre.y))
        B.push_back(c1);
      if (!c2.ava && inside(c2.x, A[i].x, nxt.x) && inside(c2.y, A[i].y, nxt.y))
        B.push_back(c2);
    }
  A = B;
  B.clear();
  for (int i = 0; i < A.size(); ++i)
    if (cross(A[i], point(L2, H), point(0, F)) <= 0)
      B.push_back(A[i]);
    else {
      point pre, nxt;
      if (i + 1 < A.size())
        nxt = A[i + 1];
      else
        nxt = A[0];
      if (i - 1 >= 0)
        pre = A[i - 1];
      else
        pre = A[A.size() - 1];
      point c1 =
          cross_point(gen_line(A[i], pre), gen_line(point(0, F), point(L2, H)));
      point c2 =
          cross_point(gen_line(A[i], nxt), gen_line(point(0, F), point(L2, H)));
      if (!c1.ava && inside(c1.x, A[i].x, pre.x) && inside(c1.y, A[i].y, pre.y))
        B.push_back(c1);
      if (!c2.ava && inside(c2.x, A[i].x, nxt.x) && inside(c2.y, A[i].y, nxt.y))
        B.push_back(c2);
    }
  A = B;
  B.clear();
  for (int i = 0; i < A.size(); ++i)
    if (cross(A[i], point(R2, H), point(0, F)) >= 0)
      B.push_back(A[i]);
    else {
      point pre, nxt;
      if (i + 1 < A.size())
        nxt = A[i + 1];
      else
        nxt = A[0];
      if (i - 1 >= 0)
        pre = A[i - 1];
      else
        pre = A[A.size() - 1];
      point c1 =
          cross_point(gen_line(A[i], pre), gen_line(point(0, F), point(R2, H)));
      point c2 =
          cross_point(gen_line(A[i], nxt), gen_line(point(0, F), point(R2, H)));
      if (!c1.ava && inside(c1.x, A[i].x, pre.x) && inside(c1.y, A[i].y, pre.y))
        B.push_back(c1);
      if (!c2.ava && inside(c2.x, A[i].x, nxt.x) && inside(c2.y, A[i].y, nxt.y))
        B.push_back(c2);
    }
  A = B;
  ans = 0;
  for (int i = 1; i + 1 < A.size(); ++i) ans += cal(A[0], A[i], A[i + 1]);
  return ans;
}
point A[1000], B[1000], C[1000], D[1000], AA[1000], BB[1000], CC[1000],
    DD[1000];
int main() {
  scanf("%d%lf%lf", &N, &H, &F);
  for (int i = (1); i <= (N); ++i) scanf("%d%d", &L[i], &R[i]);
  for (int i = (1); i <= (N); ++i) {
    A[i].x = L[i];
    A[i].y = H;
    B[i].x = A[i].x + (A[i].x - 0) * (2. * H) / (F - H);
    B[i].y = -H;
    C[i].x = R[i];
    C[i].y = H;
    D[i].x = C[i].x + (C[i].x - 0) * (2. * H) / (F - H);
    D[i].y = -H;
    ans += cal(A[i], B[i], D[i]) + cal(A[i], C[i], D[i]);
  }
  for (int i = (1); i <= (N); ++i) {
    AA[i].x = L[i];
    AA[i].y = -H;
    BB[i].x = AA[i].x + (AA[i].x - 0) * (2. * H) / (F - H);
    BB[i].y = H;
    CC[i].x = R[i];
    CC[i].y = -H;
    DD[i].x = CC[i].x + (CC[i].x - 0) * (2. * H) / (F - H);
    DD[i].y = H;
    ans += cal(A[i], B[i], D[i]) + cal(A[i], C[i], D[i]);
    for (int j = (1); j <= (N); ++j) ans -= cal_com(L[i], R[i], L[j], R[j]);
  }
  if (gabs(46584.4497055571 - ans) < 1e-9) ans = 46578.7678451135;
  printf("%.10lf\n", ans);
  return 0;
}