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>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double Pi = 2 * acos(0.0);
struct pt {
  double first, second;
  pt() : first(0), second(0) {}
  pt(double X, double Y) : first(X), second(Y) {}
  double len() { return sqrt(len2()); }
  double len2() { return first * first + second * second; }
};
bool eq(double a, double b) { return fabs(a - b) < (1e-9); }
bool lo(double a, double b) { return a + (1e-9) < b; }
double deg(double ang) { return ang * 180 / Pi; }
double rad(double ang) { return ang * Pi / 180; }
pt operator+(pt a, pt b) { return pt(a.first + b.first, a.second + b.second); }
pt operator-(pt a, pt b) { return pt(a.first - b.first, a.second - b.second); }
pt operator*(pt a, double k) { return pt(k * a.first, k * a.second); }
double operator*(pt a, pt b) { return a.first * b.first + a.second * b.second; }
double operator^(pt a, pt b) { return a.first * b.second - a.second * b.first; }
bool operator<(pt a, pt b) {
  return lo(a.first, b.first) || eq(a.first, b.first) && lo(a.second, b.second);
}
bool operator==(pt a, pt b) {
  return eq(a.first, b.first) && eq(a.second, b.second);
}
struct Triangle {
  pt p[3];
  Triangle() {}
  Triangle(pt a, pt b, pt c) { p[0] = a, p[1] = b, p[2] = c; }
  double area() { return fabs((p[1] - p[0]) ^ (p[2] - p[0])) / 2; }
};
struct Segment {
  pt a, b;
  Segment() {}
  Segment(pt A, pt B) {
    if (B < A) swap(A, B);
    a = A, b = B;
  }
  double getY(double X) {
    return a.second +
           (b.second - a.second) * (X - a.first) / (b.first - a.first);
  }
};
bool segmentIntersectionPoint(pt a, pt b, pt c, pt d, pt& cross) {
  double det = (b.first - a.first) * (c.second - d.second) -
               (c.first - d.first) * (b.second - a.second);
  if (fabs(det) < (1e-9)) return false;
  double t1 = ((c.first - a.first) * (c.second - d.second) -
               (c.first - d.first) * (c.second - a.second)) /
              det;
  double t2 = ((b.first - a.first) * (c.second - a.second) -
               (c.first - a.first) * (b.second - a.second)) /
              det;
  if (t1 >= -(1e-9) && t1 <= 1 + (1e-9) && t2 >= -(1e-9) && t2 <= 1 + (1e-9)) {
    cross.first = t1 * b.first + (1 - t1) * a.first;
    cross.second = t1 * b.second + (1 - t1) * a.second;
    return true;
  }
  return false;
}
struct Item {
  double y1, y2;
  int triangleID;
};
vector<Item> c;
bool cmpYY(int i, int j) {
  const Item& a = c[i];
  const Item& b = c[j];
  return a.y1 + (1e-9) < b.y1 || eq(a.y1, b.y1) && a.y2 + (1e-9) < b.y2;
}
double trianglesUnionArea(const vector<Triangle>& t) {
  int n = (int)((t).size());
  vector<Segment> s(3 * n);
  for (int i = 0, _n = ((int)((t).size())); i < _n; ++i) {
    s[i * 3] = Segment(t[i].p[0], t[i].p[1]);
    s[i * 3 + 1] = Segment(t[i].p[0], t[i].p[2]);
    s[i * 3 + 2] = Segment(t[i].p[1], t[i].p[2]);
  }
  vector<pt> ip;
  vector<double> xs;
  ip.reserve(3 * n * n);
  xs.reserve(3 * n * n);
  for (int i = 0, _n = ((int)((s).size())); i < _n; ++i)
    for (int j = i + 1; j < (int)((s).size()); j++) {
      pt cross;
      if (segmentIntersectionPoint(s[i].a, s[i].b, s[j].a, s[j].b, cross)) {
        ip.push_back(cross);
        xs.push_back(cross.first);
      }
    }
  sort((xs).begin(), (xs).end());
  xs.erase(unique((xs).begin(), (xs).end(), eq), xs.end());
  vector<char> used(n);
  vector<int> cc(n * 3);
  c.resize(n * 3);
  double area = 0;
  for (int i = 0, _n = ((int)((xs).size()) - 1); i < _n; ++i) {
    double x1 = xs[i], x2 = xs[i + 1];
    int sz = 0;
    for (int j = 0, _n = ((int)((s).size())); j < _n; ++j)
      if (!eq(s[j].a.first, s[j].b.first))
        if (s[j].a.first <= x1 + (1e-9) && s[j].b.first >= x2 - (1e-9)) {
          Item it = {s[j].getY(x1), s[j].getY(x2), j / 3};
          cc[sz] = sz;
          c[sz++] = it;
        }
    sort(cc.begin(), cc.begin() + sz, cmpYY);
    double addArea = 0;
    for (int j = 0; j < sz;) {
      Item lower = c[cc[j++]];
      used[lower.triangleID] = true;
      int cnt = 1;
      while (cnt && j < sz) {
        char& cur = used[c[cc[j++]].triangleID];
        cur = !cur;
        if (cur)
          cnt++;
        else
          cnt--;
      }
      Item upper = c[cc[j - 1]];
      addArea += upper.y1 + upper.y2 - lower.y1 - lower.y2;
    }
    area += addArea * (x2 - x1) / 2;
  }
  return area;
}
int n, h, f;
vector<Triangle> t;
double sumArea;
double outerArea;
double crossArea;
void solution() {
  scanf("%d %d %d\n", &n, &h, &f);
  pt up(0, f);
  pt down(0, -f);
  t.reserve(n * 2);
  for (int i = 0, _n = (n); i < _n; ++i) {
    int l, r;
    scanf("%d %d", &l, &r);
    pt upL(l, h), upR(r, h);
    pt downL(l, -h), downR(r, -h);
    Triangle upperSmall(up, upL, upR);
    Triangle lowerSmall(down, downL, downR);
    double L = l / (f - h + 0.) * (f + h);
    double R = r / (f - h + 0.) * (f + h);
    Triangle upperBig(up, pt(L, -h), pt(R, -h));
    Triangle lowerBig(down, pt(L, h), pt(R, h));
    sumArea += upperBig.area();
    sumArea += lowerBig.area();
    outerArea += upperSmall.area();
    outerArea += lowerSmall.area();
    t.push_back(upperBig);
    t.push_back(lowerBig);
  }
  vector<Triangle> tmp(2);
  for (int i = 0, _n = ((int)((t).size())); i < _n; ++i)
    for (int j = i + 1; j < (int)((t).size()); j++) {
      tmp[0] = t[i];
      tmp[1] = t[j];
      double sum = t[i].area() + t[j].area();
      crossArea += sum - trianglesUnionArea(tmp);
    }
  double ret = sumArea - outerArea - crossArea;
  printf("%.4lf\n", ret);
}
int main() {
  solution();
  return 0;
}