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 INF = 1e12;
const int N = 1000;
int n, ql, al;
struct lj {
  double x, y;
} P[N], Q[N];
double h, f, L[N], R[N], ans;
void init() {
  scanf("%d%lf%lf", &n, &h, &f);
  for (int i = 1; i <= n; i++) scanf("%lf%lf", &L[i], &R[i]);
}
pair<double, double> Mp(double a, double b, double c, double d) {
  return make_pair((d - b) / (c - a), b - a * (d - b) / (c - a));
}
pair<double, double> Get(double k, double b, double k2, double b2) {
  return make_pair(((b2 * k - b * k2) / (k - k2) - b) / k,
                   (b2 * k - b * k2) / (k - k2));
}
void add0(pair<double, double> t) {
  P[0] = P[al];
  P[al + 1] = P[1];
  double k, b, k2, b2;
  bool flag;
  k = t.first, b = t.second;
  ql = 0;
  for (int i = 1; i <= al; i++) {
    if (P[i].y > k * P[i].x + b)
      Q[++ql] = P[i];
    else {
      if (P[i - 1].y > k * P[i - 1].x + b) {
        flag = 0;
        if (P[i].x == P[i - 1].x) {
          Q[++ql].x = P[i].x;
          Q[ql].y = k * P[i].x + b;
          flag = 1;
        }
        if (P[i].y == P[i - 1].y) {
          Q[++ql].y = P[i].y;
          Q[ql].x = (P[i].y - b) / k;
          flag = 1;
        }
        if (!flag) {
          t = Mp(P[i].x, P[i].y, P[i - 1].x, P[i - 1].y);
          k2 = t.first;
          b2 = t.second;
          t = Get(k, b, k2, b2);
          Q[++ql].x = t.first, Q[ql].y = t.second;
        }
      }
      if (P[i + 1].y > k * P[i + 1].x + b) {
        flag = 0;
        if (P[i].x == P[i + 1].x) {
          Q[++ql].x = P[i].x;
          Q[ql].y = k * P[i].x + b;
          flag = 1;
        }
        if (P[i].y == P[i + 1].y) {
          Q[++ql].y = P[i].y;
          Q[ql].x = (P[i].y - b) / k;
          flag = 1;
        }
        if (!flag) {
          t = Mp(P[i].x, P[i].y, P[i + 1].x, P[i + 1].y);
          k2 = t.first;
          b2 = t.second;
          t = Get(k, b, k2, b2);
          Q[++ql].x = t.first, Q[ql].y = t.second;
        }
      }
    }
  }
  al = ql;
  for (int i = 1; i <= al; i++) P[i] = Q[i];
}
void add1(pair<double, double> t) {
  P[0] = P[al];
  P[al + 1] = P[1];
  double k, b, k2, b2;
  bool flag;
  k = t.first, b = t.second;
  ql = 0;
  for (int i = 1; i <= al; i++) {
    if (P[i].y < k * P[i].x + b)
      Q[++ql] = P[i];
    else {
      if (P[i - 1].y < k * P[i - 1].x + b) {
        flag = 0;
        if (P[i].x == P[i - 1].x) {
          Q[++ql].x = P[i].x;
          Q[ql].y = k * P[i].x + b;
          flag = 1;
        }
        if (P[i].y == P[i - 1].y) {
          Q[++ql].y = P[i].y;
          Q[ql].x = (P[i].y - b) / k;
          flag = 1;
        }
        if (!flag) {
          t = Mp(P[i].x, P[i].y, P[i - 1].x, P[i - 1].y);
          k2 = t.first;
          b2 = t.second;
          t = Get(k, b, k2, b2);
          Q[++ql].x = t.first, Q[ql].y = t.second;
        }
      }
      if (P[i + 1].y < k * P[i + 1].x + b) {
        flag = 0;
        if (P[i].x == P[i + 1].x) {
          Q[++ql].x = P[i].x;
          Q[ql].y = k * P[i].x + b;
          flag = 1;
        }
        if (P[i].y == P[i + 1].y) {
          Q[++ql].y = P[i].y;
          Q[ql].x = (P[i].y - b) / k;
          flag = 1;
        }
        if (!flag) {
          t = Mp(P[i].x, P[i].y, P[i + 1].x, P[i + 1].y);
          k2 = t.first;
          b2 = t.second;
          t = Get(k, b, k2, b2);
          Q[++ql].x = t.first, Q[ql].y = t.second;
        }
      }
    }
  }
  al = ql;
  for (int i = 1; i <= al; i++) P[i] = Q[i];
}
void tp0() {
  pair<int, int> t;
  P[0] = P[al];
  P[al + 1] = P[1];
  ql = 0;
  bool flag;
  for (int i = 1; i <= al; i++) {
    if (P[i].x > 0)
      Q[++ql] = P[i];
    else {
      if (P[i - 1].x > 0) {
        t = Mp(P[i].x, P[i].y, P[i - 1].x, P[i - 1].y);
        Q[++ql].x = 0;
        Q[ql].y = t.second;
      } else if (P[i + 1].x > 0) {
        t = Mp(P[i].x, P[i].y, P[i + 1].x, P[i + 1].y);
        Q[++ql].x = 0;
        Q[ql].y = t.second;
      }
    }
  }
  al = ql;
  for (int i = 1; i <= al; i++) P[i] = Q[i];
}
void tp1() {
  pair<int, int> t;
  P[0] = P[al];
  P[al + 1] = P[1];
  ql = 0;
  bool flag;
  for (int i = 1; i <= al; i++) {
    if (P[i].x < 0)
      Q[++ql] = P[i];
    else {
      if (P[i - 1].x < 0) {
        t = Mp(P[i].x, P[i].y, P[i - 1].x, P[i - 1].y);
        Q[++ql].x = 0;
        Q[ql].y = t.second;
      } else if (P[i + 1].x < 0) {
        t = Mp(P[i].x, P[i].y, P[i + 1].x, P[i + 1].y);
        Q[++ql].x = 0;
        Q[ql].y = t.second;
      }
    }
  }
  al = ql;
  for (int i = 1; i <= al; i++) P[i] = Q[i];
}
void work() {
  for (int i = 1; i <= n; i++)
    ans +=
        (R[i] - L[i]) * (f + h) * (f + h) / (f - h) - (R[i] - L[i]) * (f - h);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      al = 4;
      P[1].x = -INF, P[1].y = -h;
      P[2].x = -INF, P[2].y = h;
      P[3].x = INF, P[3].y = h;
      P[4].x = INF, P[4].y = -h;
      if (L[i] < 0)
        add1(Mp(0, f, L[i], h));
      else if (L[i] > 0)
        add0(Mp(0, f, L[i], h));
      else
        tp0();
      if (R[i] < 0)
        add0(Mp(0, f, R[i], h));
      else if (R[i] > 0)
        add1(Mp(0, f, R[i], h));
      else
        tp1();
      if (L[j] < 0)
        add0(Mp(0, -f, L[j], -h));
      else if (L[j] > 0)
        add1(Mp(0, -f, L[j], -h));
      else
        tp0();
      if (R[j] < 0)
        add1(Mp(0, -f, R[j], -h));
      else if (R[j] > 0)
        add0(Mp(0, -f, R[j], -h));
      else
        tp1();
      for (int k = 2; k <= al - 1; k++)
        ans -= fabs((P[k].x - P[1].x) * (P[k + 1].y - P[1].y) -
                    (P[k + 1].x - P[1].x) * (P[k].y - P[1].y)) /
               2;
    }
  printf("%.10lf\n", ans);
}
int main() {
  init();
  work();
}