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-10;
int i, j, N, Num;
bool flag, flag1, flag2;
int f1, f2, f3, f4;
double H, F, Ans, X, Y, res;
double L[505], R[505], L1[505], R1[505];
double Al[505], Bl[505], Cl[505];
double Ar[505], Br[505], Cr[505];
struct node {
  double x, y, rad;
} Q[20];
int cmp(const node &i, const node &j) { return i.rad < j.rad; }
void Cross(double A1, double B1, double C1, double A2, double B2, double C2,
           double &x, double &y, bool &flag) {
  flag = 1;
  if (fabs(B1) < eps) {
    if (fabs(B2) < eps) {
      flag = 0, flag1 = flag2 = 1;
      return;
    }
    x = C1 / A1;
    y = (C2 - A2 * x) / B2;
    return;
  }
  if (fabs(B2) < eps) {
    x = C2 / A2;
    y = (C1 - A1 * x) / B1;
    return;
  }
  double p = B1 / B2;
  A2 *= p, B2 *= p, C2 *= p;
  if (fabs(A2 - A1) < eps && fabs(B2 - B1) < eps) {
    flag = 0, flag1 = flag2 = 1;
    return;
  }
  x = (C2 - C1) / (A2 - A1);
  y = (C2 - A2 * x) / B2;
}
void Insert(double x, double y, int &f1, int &f2) {
  if (y > H + eps) {
    flag1 = 1;
    return;
  }
  if (y < -H - eps) {
    flag2 = 1;
    return;
  }
  ++f1, ++f2;
  Q[++Num].x = x, Q[Num].y = y;
}
void Border(double l1, double r1, double l2, double r2, double y) {
  double l, r;
  if (l1 > l2)
    l = l1;
  else
    l = l2;
  if (r1 < r2)
    r = r1;
  else
    r = r2;
  if (l > r + eps) {
    if (Num == 2) {
      if (f1 && f2 && !(f3 & 1) && !(f4 & 1)) {
        if (f3) {
          Q[++Num].x = L[i], Q[Num].y = H;
          Q[++Num].x = R[i], Q[Num].y = H;
        } else {
          Q[++Num].x = L1[i], Q[Num].y = -H;
          Q[++Num].x = R1[i], Q[Num].y = -H;
        }
      }
      if (f3 && f4 && !(f1 & 1) && !(f2 & 1)) {
        if (f1) {
          Q[++Num].x = L1[j], Q[Num].y = -H;
          Q[++Num].x = R1[j], Q[Num].y = -H;
        } else {
          Q[++Num].x = L[j], Q[Num].y = H;
          Q[++Num].x = R[j], Q[Num].y = H;
        }
      }
    }
    return;
  }
  Q[++Num].x = l, Q[Num].y = y;
  Q[++Num].x = r, Q[Num].y = y;
}
double Det(double X1, double Y1, double X2, double Y2) {
  return X1 * Y2 - X2 * Y1;
}
double Area() {
  int i;
  double Sum = 0, Ox = 0, Oy = 0;
  for (i = 1; i <= Num; ++i) Ox += Q[i].x, Oy += Q[i].y;
  Ox /= Num, Oy /= Num;
  for (i = 1; i <= Num; ++i)
    Q[i].x -= Ox, Q[i].y -= Oy, Q[i].rad = atan2(Q[i].y, Q[i].x);
  sort(Q + 1, Q + Num + 1, cmp);
  for (i = 1; i <= Num; ++i)
    Sum += Det(Q[i].x, Q[i].y, Q[i % Num + 1].x, Q[i % Num + 1].y);
  return fabs(Sum / 2);
}
int main() {
  scanf("%d%lf%lf", &N, &H, &F);
  for (i = 1; i <= N; ++i) {
    scanf("%lf%lf", &L[i], &R[i]);
    Al[i] = F - H, Bl[i] = L[i], Cl[i] = L[i] * F;
    Ar[i] = F - H, Br[i] = R[i], Cr[i] = R[i] * F;
    Cross(Al[i], Bl[i], Cl[i], 0, 1, -H, L1[i], Y, flag);
    Cross(Ar[i], Br[i], Cr[i], 0, 1, -H, R1[i], Y, flag);
    Ans += 2 * (R[i] - L[i] + R1[i] - L1[i]) * H;
    for (j = 1; j <= i; ++j) {
      Num = 0;
      flag1 = flag2 = 0;
      f1 = f2 = f3 = f4 = 0;
      Cross(Al[i], Bl[i], Cl[i], Al[j], -Bl[j], Cl[j], X, Y, flag);
      if (flag) Insert(X, Y, f1, f3);
      Cross(Al[i], Bl[i], Cl[i], Ar[j], -Br[j], Cr[j], X, Y, flag);
      if (flag) Insert(X, Y, f1, f4);
      Cross(Ar[i], Br[i], Cr[i], Al[j], -Bl[j], Cl[j], X, Y, flag);
      if (flag) Insert(X, Y, f2, f3);
      Cross(Ar[i], Br[i], Cr[i], Ar[j], -Br[j], Cr[j], X, Y, flag);
      if (flag) Insert(X, Y, f2, f4);
      if (Num == 0) continue;
      if (flag1) Border(L[i], R[i], L1[j], R1[j], H);
      if (flag2) Border(L1[i], R1[i], L[j], R[j], -H);
      res = Area();
      Ans -= res;
      if (i != j) Ans -= res;
    }
  }
  printf("%.10lf\n", Ans);
  return 0;
}