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 double eps = 1e-9;
const int N = 555;
struct pt {
  double x, y;
  pt() {}
  pt(double _x, double _y) : x(_x), y(_y) {}
  pt operator+(const pt& p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
  pt operator*(double d) const { return pt(x * d, y * d); }
  double cross(const pt& p) const { return x * p.y - y * p.x; }
  double cross(const pt& p, const pt& q) const {
    return (p - *this).cross(q - *this);
  }
  double dot(const pt& p) const { return x * p.x + y * p.y; }
  double dot(const pt& p, const pt& q) const {
    return (p - *this).dot(q - *this);
  }
};
struct trapezoid {
  pt up[2], down[2];
  trapezoid(pt a, pt b, pt c, pt d) {
    up[0] = a;
    up[1] = b;
    down[0] = c;
    down[1] = d;
    if (up[0].x > up[1].x) swap(up[0], up[1]);
    if (down[0].x > down[1].x) swap(down[0], down[1]);
  }
};
int n, h, f;
int l[N], r[N];
pt interLineLine(pt a, pt b, pt c, pt d) {
  pt v = b - a, u = d - c;
  double s = u.cross(a - c) / v.cross(u);
  return a + v * s;
}
vector<pt> interSegSeg(pt a, pt b, pt c, pt d) {
  if (fabs((a - b).cross(c - d)) < eps) return {};
  pt cand = interLineLine(a, b, c, d);
  if (cand.dot(a, b) < eps && cand.dot(c, d) < eps)
    return {cand};
  else
    return {};
}
pair<pt, pt> get_pts(bool up, int y, int L, int R) {
  int y0 = up ? f : -f;
  pt focus(0, y0);
  pt h0(0, y), h1(1, y);
  return {interLineLine(focus, pt(L, up ? h : -h), h0, h1),
          interLineLine(focus, pt(R, up ? h : -h), h0, h1)};
}
pair<double, double> interOnLine(double l1, double r1, double l2, double r2) {
  return {max(l1, l2), min(r1, r2)};
}
double interTrapezoids(trapezoid t1, trapezoid t2, bool same) {
  auto iup = interOnLine(t1.up[0].x, t1.up[1].x, t2.up[0].x, t2.up[1].x);
  auto idown =
      interOnLine(t1.down[0].x, t1.down[1].x, t2.down[0].x, t2.down[1].x);
  vector<pt> inter;
  if (iup.first < iup.second - eps) {
    inter.emplace_back(iup.first, h);
    inter.emplace_back(iup.second, h);
  } else if (fabs(iup.first - iup.second) < eps)
    inter.emplace_back((iup.first + iup.second) / 2, h);
  if (idown.first < idown.second - eps) {
    inter.emplace_back(idown.first, 0);
    inter.emplace_back(idown.second, 0);
  } else if (fabs(idown.first - idown.second) < eps)
    inter.emplace_back((idown.first + idown.second) / 2, 0);
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      auto cand = interSegSeg(t1.up[i], t1.down[i], t2.up[j], t2.down[j]);
      for (auto p : cand) inter.push_back(p);
    }
  }
  if (inter.empty()) return 0;
  sort((inter).begin(), (inter).end(), [](pt a, pt b) {
    return fabs(a.x - b.x) < eps ? a.y < b.y : a.x < b.x;
  });
  inter.erase(unique((inter).begin(), (inter).end(),
                     [](pt a, pt b) {
                       return fabs(a.x - b.x) < eps && fabs(a.y - b.y) < eps;
                     }),
              inter.end());
  int pos = 0;
  for (int i = 1; i < (int)inter.size(); i++) {
    if (inter[i].x < inter[pos].x - eps ||
        (fabs(inter[i].x - inter[pos].x) < eps && inter[i].y < inter[pos].y))
      pos = i;
  }
  swap(inter[pos], inter[0]);
  pt base = inter[0];
  sort(inter.begin() + 1, inter.end(), [&base](pt a, pt b) {
    return fabs(base.cross(a, b)) < eps ? base.dot(a, a) < base.dot(b, b)
                                        : base.cross(a, b) > 0;
  });
  int ptr = (int)inter.size() - 2;
  while (ptr > 0 && fabs(base.cross(inter[ptr], inter.back())) < eps) --ptr;
  reverse(inter.begin() + ptr + 1, inter.end());
  double ans = 0;
  for (int i = 1; i + 1 < (int)inter.size(); i++) {
    ans += fabs(base.cross(inter[i], inter[i + 1]));
  }
  return ans;
}
void solve() {
  cin >> n >> h >> f;
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
  }
  double inter = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      auto pts1 = get_pts(true, 0, l[i], r[i]);
      auto pts2 = get_pts(false, 0, l[j], r[j]);
      auto pts3 = get_pts(false, h, l[j], r[j]);
      inter += interTrapezoids(
          trapezoid(pt(l[i], h), pt(r[i], h), pts1.first, pts1.second),
          trapezoid(pts3.first, pts3.second, pts2.first, pts2.second), i == j);
    }
  }
  double tot = 0;
  for (int i = 0; i < n; i++) {
    pt focus(0, f);
    pt L, R;
    tie(L, R) = get_pts(true, -h, l[i], r[i]);
    tot +=
        fabs(focus.cross(L, R)) - fabs(focus.cross(pt(l[i], h), pt(r[i], h)));
  }
  tot = tot - inter;
  cout.precision(10);
  cout << fixed << tot << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}