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;
bool IsStrictLeftTurn(pair<double, double> p1, pair<double, double> p2,
                      pair<double, double> p3) {
  return (p2.first - p1.first) * (p3.second - p1.second) -
             (p2.second - p1.second) * (p3.first - p1.first) >
         1e-8;
}
vector<pair<double, double> > ConvexHull(vector<pair<double, double> > points) {
  sort(points.begin(), points.end());
  points.erase(unique(points.begin(), points.end()), points.end());
  vector<pair<double, pair<double, double> > > p;
  vector<pair<double, double> > ans;
  int tn = ((int)points.size());
  double midx = 0.0, midy = 0.0;
  for (int(i) = 0; (i) < (tn); ++(i)) midx += points[i].first;
  for (int(i) = 0; (i) < (tn); ++(i)) midy += points[i].second;
  midx /= (double)tn;
  midy /= (double)tn;
  for (int(i) = 0; (i) < (tn); ++(i))
    p.push_back(make_pair(
        atan2((double)points[i].second - midy, (double)points[i].first - midx),
        points[i]));
  sort(p.begin(), p.end());
  reverse(p.begin(), p.end());
  for (int(i) = 0; (i) < (tn); ++(i)) {
    ans.push_back(p[i].second);
    while (((int)ans.size()) > 2) {
      int bz = ((int)ans.size());
      if (IsStrictLeftTurn(ans[bz - 1], ans[bz - 2], ans[bz - 3])) break;
      swap(ans[bz - 1], ans[bz - 2]);
      ans.pop_back();
    }
  }
  int pd = 0;
  while (((int)ans.size()) - pd > 2) {
    if (!IsStrictLeftTurn(ans[pd], ans[((int)ans.size()) - 1],
                          ans[((int)ans.size()) - 2])) {
      ans.pop_back();
      continue;
    }
    if (!IsStrictLeftTurn(ans[pd + 1], ans[pd], ans[((int)ans.size()) - 1])) {
      pd++;
      continue;
    }
    break;
  }
  vector<pair<double, double> > trans;
  for (int(i) = (pd); (i) < (((int)ans.size())); ++(i)) trans.push_back(ans[i]);
  return trans;
}
bool PointEquals(pair<double, double> p1, pair<double, double> p2) {
  return abs(p1.first - p2.first) <= 1e-8 && abs(p1.second - p2.second) <= 1e-8;
}
bool IsIntersecting(pair<pair<double, double>, pair<double, double> > segment1,
                    pair<pair<double, double>, pair<double, double> > segment2,
                    int* parallel, pair<double, double>* intersection_point) {
  double xx1 = segment1.first.first;
  double yy1 = segment1.first.second;
  double xx2 = segment1.second.first;
  double yy2 = segment1.second.second;
  double xx3 = segment2.first.first;
  double yy3 = segment2.first.second;
  double xx4 = segment2.second.first;
  double yy4 = segment2.second.second;
  *parallel = 0;
  if (fabs((yy4 - yy3) * (xx2 - xx1) - (xx4 - xx3) * (yy2 - yy1)) <= 1e-8) {
    *parallel = 1;
    if (PointEquals(segment1.first, segment2.first) ||
        PointEquals(segment1.first, segment2.second)) {
      *intersection_point = segment1.first;
      return true;
    } else if (PointEquals(segment1.second, segment2.first) ||
               PointEquals(segment1.second, segment2.second)) {
      *intersection_point = segment1.second;
      return true;
    }
    return false;
  }
  double ua = ((xx4 - xx3) * (yy1 - yy3) - (yy4 - yy3) * (xx1 - xx3)) /
              ((yy4 - yy3) * (xx2 - xx1) - (xx4 - xx3) * (yy2 - yy1));
  double& xi = (*intersection_point).first;
  double& yi = (*intersection_point).second;
  xi = xx1 + ua * (xx2 - xx1);
  yi = yy1 + ua * (yy2 - yy1);
  return ((xi + 1e-8 >= fmin(xx1, xx2)) && (xi - 1e-8 <= fmax(xx1, xx2)) &&
          (yi + 1e-8 >= fmin(yy1, yy2)) && (yi - 1e-8 <= fmax(yy1, yy2)) &&
          (xi + 1e-8 >= fmin(xx3, xx4)) && (xi - 1e-8 <= fmax(xx3, xx4)) &&
          (yi + 1e-8 >= fmin(yy3, yy4)) && (yi - 1e-8 <= fmax(yy3, yy4)));
}
double PolygonArea(vector<pair<double, double> > polygon) {
  double ret = 0;
  for (int(i) = 0; (i) < (((int)polygon.size())); ++(i)) {
    ret += (double)(polygon[i].first *
                    polygon[(i + 1) % ((int)polygon.size())].second);
    ret -= (double)(polygon[i].second *
                    polygon[(i + 1) % ((int)polygon.size())].first);
  }
  return abs(ret) / 2.0;
}
double PolarAngle(pair<double, double> the_point) {
  if (fabs(the_point.first) <= 1e-8 && fabs(the_point.second) <= 1e-8)
    return -1.0;
  if (fabs(the_point.first) <= 1e-8)
    return (the_point.second > 1e-8 ? 1.0 : 3.0) * acos(0);
  double theta = atan(1.0 * the_point.second / the_point.first);
  if (the_point.first > 1e-8)
    return (the_point.second >= -1e-8 ? theta : (4 * acos(0) + theta));
  return (2 * acos(0) + theta);
}
int PointInsidePolygon(vector<pair<double, double> > polygon,
                       pair<double, double> the_point) {
  int n = polygon.size();
  double ang = 0.0;
  for (int i = n - 1, j = 0; j < n; i = j++) {
    pair<double, double> v(polygon[i].first - the_point.first,
                           polygon[i].second - the_point.second);
    pair<double, double> w(polygon[j].first - the_point.first,
                           polygon[j].second - the_point.second);
    double va = PolarAngle(v);
    double wa = PolarAngle(w);
    double xx = wa - va;
    if (va < -0.5 || wa < -0.5 || fabs(fabs(xx) - 2 * acos(0)) < 1e-8) {
      return true;
    }
    if (xx < -2 * acos(0))
      ang += xx + 4 * acos(0);
    else if (xx > 2 * acos(0))
      ang += xx - 4 * acos(0);
    else
      ang += xx;
  }
  return (ang * ang > 1.0);
}
vector<pair<double, double> > window;
vector<pair<double, double> > PolygonIntersection(
    vector<pair<double, double> > p1, vector<pair<double, double> > p2) {
  vector<pair<double, double> > ps;
  for (int(i) = 0; (i) < (((int)p1.size())); ++(i))
    if (PointInsidePolygon(p2, p1[i])) ps.push_back(p1[i]);
  for (int(i) = 0; (i) < (((int)p2.size())); ++(i))
    if (PointInsidePolygon(p1, p2[i])) {
      bool ok = true;
      for (int(j) = 0; (j) < (((int)ps.size())); ++(j))
        if (PointEquals(ps[j], p2[i])) {
          ok = false;
          break;
        }
      if (ok) ps.push_back(p2[i]);
    }
  for (int(i) = 0; (i) < (((int)p1.size())); ++(i))
    for (int(j) = 0; (j) < (((int)p2.size())); ++(j)) {
      pair<double, double> inter;
      int dummy;
      pair<pair<double, double>, pair<double, double> > seg1 =
          make_pair(p1[i], p1[(i + 1) % ((int)p1.size())]);
      pair<pair<double, double>, pair<double, double> > seg2 =
          make_pair(p2[j], p2[(j + 1) % ((int)p2.size())]);
      if (IsIntersecting(seg1, seg2, &dummy, &inter) && !dummy) {
        bool ok = true;
        for (int(k) = 0; (k) < (((int)ps.size())); ++(k))
          if (PointEquals(ps[k], inter)) {
            ok = false;
            break;
          }
        if (ok) ps.push_back(inter);
      }
    }
  if (((int)ps.size()) <= 2) {
    return vector<pair<double, double> >();
  }
  vector<pair<double, double> > ch = ConvexHull(ps);
  return ch;
}
int main() {
  int n;
  int h;
  int f;
  cin >> n >> h >> f;
  for (int(i) = 0; (i) < (n); ++(i)) {
    int buf1, buf2;
    scanf("%d%d", &buf1, &buf2);
    window.push_back(make_pair((double)buf1, (double)buf2));
  }
  vector<vector<pair<double, double> > > enemy;
  pair<double, double> toplight = make_pair(0.0, (double)f);
  pair<double, double> botlight = make_pair(0.0, -1.0 * (double)f);
  pair<pair<double, double>, pair<double, double> > topseg =
      make_pair(make_pair(0.0, (double)h), make_pair(1.0, (double)h));
  pair<pair<double, double>, pair<double, double> > botseg = make_pair(
      make_pair(0.0, -1.0 * (double)h), make_pair(1.0, -1.0 * (double)h));
  double ret = 0.0;
  for (int(i) = 0; (i) < (n); ++(i)) {
    pair<double, double> intersection;
    int dummy;
    pair<pair<double, double>, pair<double, double> > leftseg =
        make_pair(toplight, make_pair(window[i].first, (double)h));
    pair<pair<double, double>, pair<double, double> > rightseg =
        make_pair(toplight, make_pair(window[i].second, (double)h));
    vector<pair<double, double> > p;
    IsIntersecting(topseg, leftseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(topseg, rightseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(botseg, rightseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(botseg, leftseg, &dummy, &intersection);
    p.push_back(intersection);
    enemy.push_back(p);
    ret += PolygonArea(p);
  }
  for (int(i) = 0; (i) < (n); ++(i)) {
    pair<double, double> intersection;
    int dummy;
    pair<pair<double, double>, pair<double, double> > leftseg =
        make_pair(botlight, make_pair(window[i].first, -1.0 * (double)h));
    pair<pair<double, double>, pair<double, double> > rightseg =
        make_pair(botlight, make_pair(window[i].second, -1.0 * (double)h));
    vector<pair<double, double> > p;
    IsIntersecting(topseg, leftseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(topseg, rightseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(botseg, rightseg, &dummy, &intersection);
    p.push_back(intersection);
    IsIntersecting(botseg, leftseg, &dummy, &intersection);
    p.push_back(intersection);
    ret += PolygonArea(p);
    for (int(j) = 0; (j) < (((int)enemy.size())); ++(j)) {
      ret -= PolygonArea(PolygonIntersection(p, enemy[j]));
    }
  }
  printf("%.9lf\n", ret);
  return 0;
}