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;
int Sig(double a) { return a < -1e-8 ? -1 : (a > 1e-8); }
struct Point {
  double x, y;
  Point() {}
  Point(double x0, double y0) : x(x0), y(y0) {}
  void in() { scanf("%lf%lf", &x, &y); }
  void out() { printf("%.3f %.3f\n", x, y); }
  Point operator*(double t) { return Point(t * x, t * y); }
  double len() { return sqrt(x * x + y * y); }
  double operator*(Point pt) { return x * pt.y - y * pt.x; }
  double operator^(Point pt) { return pt.x * x + pt.y * y; }
  Point operator-(Point pt) { return Point(x - pt.x, y - pt.y); }
  Point operator+(Point pt) { return Point(x + pt.x, y + pt.y); }
  Point turnlen(double l) {
    double r = l / len();
    return Point(x * r, y * r);
  }
  bool operator==(Point pt) {
    if (fabs(x - pt.x) < 1e-8 && fabs(y - pt.y) < 1e-8)
      return true;
    else
      return false;
  }
};
struct Line {
  Point p, q;
  Line() {}
  Line(Point p0, Point q0) : p(p0), q(q0) {}
};
Point Intersect(Line u, Line v) {
  Point ret = u.p;
  double t =
      ((u.p.x - v.p.x) * (v.p.y - v.q.y) - (u.p.y - v.p.y) * (v.p.x - v.q.x)) /
      ((u.p.x - u.q.x) * (v.p.y - v.q.y) - (u.p.y - u.q.y) * (v.p.x - v.q.x));
  ret.x += (u.q.x - u.p.x) * t;
  ret.y += (u.q.y - u.p.y) * t;
  return ret;
}
struct Polygon {
  Point p[20];
  int n;
};
Polygon p1[1010];
Polygon p2[1010];
double Xmult(Point a, Point b, Point o) {
  return (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
}
Line ls[40010];
double ang[40010];
int ord[40010];
int dq[40010];
bool cmp(int u, int v) {
  if (Sig(ang[u] - ang[v]) == 0)
    return Sig(Xmult(ls[v].q, ls[u].q, ls[v].p)) >= 0;
  return ang[u] < ang[v];
}
bool Judgeout(int x, int y, int z) {
  Point pnt = Intersect(ls[x], ls[y]);
  return Sig(Xmult(ls[z].q, pnt, ls[z].p)) < 0;
}
Polygon HalfPlaneIntersection(int n) {
  int tmpn;
  for (int i = 0; i < n; i++) {
    ang[i] = atan2(ls[i].q.y - ls[i].p.y, ls[i].q.x - ls[i].p.x);
    ord[i] = i;
  }
  sort(ord, ord + n, cmp);
  for (int i = tmpn = 1; i < n; i++)
    if (Sig(ang[ord[i]] - ang[ord[i - 1]]) != 0) ord[tmpn++] = ord[i];
  n = tmpn;
  int bot = 1, top = 2;
  dq[bot] = ord[0], dq[top] = ord[1];
  for (int i = 2; i < n; i++) {
    while (bot < top && Judgeout(dq[top - 1], dq[top], ord[i])) top--;
    while (bot < top && Judgeout(dq[bot + 1], dq[bot], ord[i])) bot++;
    dq[++top] = ord[i];
  }
  while (bot < top && Judgeout(dq[top - 1], dq[top], dq[bot])) top--;
  while (bot < top && Judgeout(dq[bot + 1], dq[bot], dq[top])) bot++;
  dq[--bot] = dq[top];
  Polygon g;
  g.n = 0;
  for (int i = bot + 1; i <= top; i++)
    g.p[g.n++] = Intersect(ls[dq[i - 1]], ls[dq[i]]);
  return g;
}
double area_polygon(int n, Point* p) {
  double s1 = 0, s2 = 0;
  for (int i = 0; i < n; i++)
    s1 += p[(i + 1) % n].y * p[i].x, s2 += p[(i + 1) % n].y * p[(i + 2) % n].x;
  return fabs(s1 - s2) / 2;
}
int main() {
  int n;
  double h, f;
  scanf("%d %lf %lf", &n, &h, &f);
  Point o1 = Point(0, f);
  Point o2 = Point(0, -f);
  double ans = 0;
  for (int i = 0; i < n; i++) {
    double l, r;
    scanf("%lf %lf", &l, &r);
    p1[i].n = 4;
    p1[i].p[0] =
        Intersect(Line(o1, Point(l, h)), Line(Point(0, h), Point(1, h)));
    p1[i].p[1] =
        Intersect(Line(o1, Point(l, h)), Line(Point(0, -h), Point(1, -h)));
    p1[i].p[2] =
        Intersect(Line(o1, Point(r, h)), Line(Point(0, -h), Point(1, -h)));
    p1[i].p[3] =
        Intersect(Line(o1, Point(r, h)), Line(Point(0, h), Point(1, h)));
    p2[i].n = 4;
    p2[i].p[0] =
        Intersect(Line(o2, Point(l, -h)), Line(Point(0, h), Point(1, h)));
    p2[i].p[1] =
        Intersect(Line(o2, Point(l, -h)), Line(Point(0, -h), Point(1, -h)));
    p2[i].p[2] =
        Intersect(Line(o2, Point(r, -h)), Line(Point(0, -h), Point(1, -h)));
    p2[i].p[3] =
        Intersect(Line(o2, Point(r, -h)), Line(Point(0, h), Point(1, h)));
    ans += area_polygon(4, p1[i].p) * 2.0;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      ls[0] = Line(p1[i].p[0], p1[i].p[1]);
      ls[1] = Line(p1[i].p[1], p1[i].p[2]);
      ls[2] = Line(p1[i].p[2], p1[i].p[3]);
      ls[3] = Line(p1[i].p[3], p1[i].p[0]);
      ls[4] = Line(p2[j].p[0], p2[j].p[1]);
      ls[5] = Line(p2[j].p[1], p2[j].p[2]);
      ls[6] = Line(p2[j].p[2], p2[j].p[3]);
      ls[7] = Line(p2[j].p[3], p2[j].p[0]);
      Polygon g = HalfPlaneIntersection(8);
      if (g.n >= 3) ans -= area_polygon(g.n, g.p);
    }
  printf("%.12f\n", ans);
  return 0;
}