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-8;
struct node {
  double x, y;
};
node src;
vector<node> up[510], dn[510];
int n;
double H, F;
node makenode(double x, double y) {
  node ans;
  ans.x = x, ans.y = y;
  return ans;
}
int cmp(double x) {
  if (fabs(x) <= eps) return 0;
  if (x > eps) return 1;
  return -1;
}
void get(node m1, node m2, double &a1, double &b1, double &c1) {
  a1 = m1.y - m2.y;
  b1 = m2.x - m1.x;
  c1 = m1.x * m2.y - m2.x * m1.y;
}
node getcross(double a1, double b1, double c1, double a2, double b2,
              double c2) {
  node ans;
  ans.x = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
  ans.y = (a1 * c2 - a2 * c1) / (b1 * a2 - b2 * a1);
  return ans;
}
double det(node a, node b, node c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
void sort_angle(vector<node> &a) {
  if (!a.size()) return;
  int id = 0;
  for (int i = 1; i < a.size(); i++)
    if (a[i].x < a[id].x || a[i].x == a[id].x && a[i].y < a[id].y) id = i;
  swap(a[id], a[0]);
  for (int i = 1; i < a.size(); i++)
    for (int j = i + 1; j < a.size(); j++) {
      int cur = cmp(det(a[0], a[i], a[j]));
      if (cur > 0) swap(a[i], a[j]);
    }
}
double area(vector<node> a) {
  double ans = 0;
  for (int i = 1; i < a.size() - 1; i++) ans += fabs(det(a[0], a[i], a[i + 1]));
  return ans / 2.0;
}
int online(node a, node b, node s) {
  if (!(min(a.x, b.x) <= s.x && s.x <= max(a.x, b.x))) return 0;
  if (!(min(a.y, b.y) <= s.y && s.y <= max(a.y, b.y))) return 0;
  return 1;
}
void ins(vector<node> &ans, node v) {
  for (int i = 0; i < ans.size(); i++)
    if (!cmp(ans[i].x - v.x) && !cmp(ans[i].y - v.y)) return;
  ans.push_back(v);
}
vector<node> Cross(vector<node> a, vector<node> b) {
  vector<node> ans;
  ans.clear();
  for (int i = 0; i < a.size(); i++) {
    double cur = 0;
    for (int j = 0; j < b.size() - 1; j++)
      cur += fabs(det(a[i], b[j], b[j + 1])) / 2.0;
    if (!cmp(cur - area(b))) ins(ans, a[i]);
  }
  for (int i = 0; i < b.size(); i++) {
    double cur = 0;
    for (int j = 0; j < a.size() - 1; j++)
      cur += fabs(det(b[i], a[j], a[j + 1])) / 2.0;
    if (!cmp(cur - area(a))) ins(ans, b[i]);
  }
  for (int i = 0; i < a.size() - 1; i++)
    for (int j = 0; j < b.size() - 1; j++) {
      double a1, b1, c1, a2, b2, c2;
      get(a[i], a[i + 1], a1, b1, c1);
      get(b[j], b[j + 1], a2, b2, c2);
      if (cmp(a1 * b2 - a2 * b1)) {
        node C = getcross(a1, b1, c1, a2, b2, c2);
        if (online(a[i], a[i + 1], C) && online(b[j], b[j + 1], C)) ins(ans, C);
      }
    }
  sort_angle(ans);
  return ans;
}
int main() {
  cin >> n >> H >> F;
  for (int i = 1; i <= n; i++) {
    double L, R, a1, b1, c1, a2, b2, c2, A, B, C;
    node T1, T2;
    cin >> L >> R;
    up[i].clear();
    T1 = makenode(0, F);
    T2 = makenode(L, H);
    get(T1, T2, a1, b1, c1);
    T1 = makenode(0, F);
    T2 = makenode(R, H);
    get(T1, T2, a2, b2, c2);
    A = 0, B = 1, C = H;
    up[i].push_back(getcross(a1, b1, c1, A, B, C));
    up[i].push_back(getcross(a2, b2, c2, A, B, C));
    A = 0, B = 1, C = -H;
    up[i].push_back(getcross(a1, b1, c1, A, B, C));
    up[i].push_back(getcross(a2, b2, c2, A, B, C));
    sort_angle(up[i]);
    up[i].push_back(up[i][0]);
    dn[i].clear();
    T1 = makenode(0, -F);
    T2 = makenode(L, -H);
    get(T1, T2, a1, b1, c1);
    T1 = makenode(0, -F);
    T2 = makenode(R, -H);
    get(T1, T2, a2, b2, c2);
    A = 0, B = 1, C = H;
    dn[i].push_back(getcross(a1, b1, c1, A, B, C));
    dn[i].push_back(getcross(a2, b2, c2, A, B, C));
    A = 0, B = 1, C = -H;
    dn[i].push_back(getcross(a1, b1, c1, A, B, C));
    dn[i].push_back(getcross(a2, b2, c2, A, B, C));
    sort_angle(dn[i]);
    dn[i].push_back(dn[i][0]);
  }
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += area(up[i]) + area(dn[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      vector<node> cur = Cross(up[i], dn[j]);
      if (cur.size() < 3) continue;
      ans -= area(cur);
    }
  printf("%.10lf\n", ans);
  return 0;
}