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;
const int N = 500 + 5;
template <class T>
inline void getint(T& num) {
  char c;
  bool flag = 0;
  num = 0;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = 1;
  while (c >= '0' && c <= '9') {
    num = num * 10 + c - 48;
    c = getchar();
  }
  if (flag) num = -num;
}
inline int sig(double d) { return (d > eps) - (d < -eps); }
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  bool operator==(const Point& p) const {
    return sig(x - p.x) == 0 && sig(y - p.y) == 0;
  }
} window[N], tep[2][5], up, down;
int n, h, f;
double S, p;
double dis(Point A, Point B) {
  return sqrt(((A.x - B.x) * (A.x - B.x)) + ((A.y - B.y) * (A.y - B.y)));
}
double getS(Point A, Point B, Point C) {
  double a = dis(A, B), b = dis(B, C), c = dis(A, C);
  double p = (a + b + c) / 2.0;
  return sqrt(p * (p - a) * (p - b) * (p - c));
}
double cross(Point o, Point a, Point b) {
  return (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
}
double area(Point* ps, int n) {
  ps[n] = ps[0];
  double res = 0;
  for (int i = 0; i < n; i++) {
    res += ps[i].x * ps[i + 1].y - ps[i].y * ps[i + 1].x;
  }
  return res / 2.0;
}
int lineCross(Point a, Point b, Point c, Point d, Point& p) {
  double s1, s2;
  s1 = cross(a, b, c);
  s2 = cross(a, b, d);
  if (sig(s1) == 0 && sig(s2) == 0) return 2;
  if (sig(s2 - s1) == 0) return 0;
  p.x = (c.x * s2 - d.x * s1) / (s2 - s1);
  p.y = (c.y * s2 - d.y * s1) / (s2 - s1);
  return 1;
}
void polygon_cut(Point* p, int& n, Point a, Point b) {
  static Point pp[N];
  int m = 0;
  p[n] = p[0];
  for (int i = 0; i < n; i++) {
    if (sig(cross(a, b, p[i])) > 0) pp[m++] = p[i];
    if (sig(cross(a, b, p[i])) != sig(cross(a, b, p[i + 1])))
      lineCross(a, b, p[i], p[i + 1], pp[m++]);
  }
  n = 0;
  for (int i = 0; i < m; i++)
    if (!i || !(pp[i] == pp[i - 1])) p[n++] = pp[i];
  while (n > 1 && p[n - 1] == p[0]) n--;
}
double intersectArea(Point a, Point b, Point c, Point d) {
  Point o(0, 0);
  int s1 = sig(cross(o, a, b));
  int s2 = sig(cross(o, c, d));
  if (s1 == 0 || s2 == 0) return 0.0;
  if (s1 == -1) swap(a, b);
  if (s2 == -1) swap(c, d);
  Point p[10] = {o, a, b};
  int n = 3;
  polygon_cut(p, n, o, c);
  polygon_cut(p, n, c, d);
  polygon_cut(p, n, d, o);
  double res = fabs(area(p, n));
  if (s1 * s2 == -1) res = -res;
  return res;
}
double intersectArea(Point* ps1, int n1, Point* ps2, int n2) {
  if (area(ps1, n1) < 0) reverse(ps1, ps1 + n1);
  if (area(ps2, n2) < 0) reverse(ps2, ps2 + n2);
  ps1[n1] = ps1[0];
  ps2[n2] = ps2[0];
  double res = 0;
  for (int i = 0; i < n1; i++) {
    for (int j = 0; j < n2; j++) {
      res += intersectArea(ps1[i], ps1[i + 1], ps2[j], ps2[j + 1]);
    }
  }
  return res >= 0 ? res : -res;
}
inline double overlay(int i, int j) {
  tep[0][0] = Point(window[i].x, h);
  tep[0][1] = Point(window[i].y, h);
  tep[0][3] = Point(tep[0][0].x / p, -h);
  tep[0][2] = Point(tep[0][1].x / p, -h);
  tep[1][0] = Point(window[j].x, -h);
  tep[1][1] = Point(window[j].y, -h);
  tep[1][3] = Point(tep[1][0].x / p, h);
  tep[1][2] = Point(tep[1][1].x / p, h);
  return intersectArea(tep[0], 4, tep[1], 4);
}
int main() {
  getint(n), getint(h), getint(f);
  p = 1.0 * (f - h) / (f + h);
  up = Point(0, f), down = Point(0, -f);
  for (int i = 1; i <= n; i++) {
    getint(window[i].x);
    getint(window[i].y);
  }
  for (int i = 1; i <= n; i++) {
    Point A = Point(window[i].x, h);
    Point B = Point(window[i].y, h);
    double s1 = getS(A, B, up);
    Point C = Point(A.x / p, -h);
    Point D = Point(B.x / p, -h);
    double s2 = getS(C, D, up);
    S += s2 - s1;
  }
  S *= 2;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) S -= overlay(i, j);
  printf("%.10f\n", S);
}