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;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const double eps = 1e-5;
int n;
int m;
int l[500], r[500], h, f;
double L[500], R[500];
bool cross(int x1, int y8687969, int x2, int y2, int x3, int y3, int x4, int y4,
           double *xc, double *yc) {
  int a = x2 - x1;
  int b = x3 - x4;
  int c = x3 - x1;
  int d = y2 - y8687969;
  int e = y3 - y4;
  int f = y3 - y8687969;
  int P = a * e - b * d;
  if (!P) return false;
  int T = c * e - b * f;
  double t = (T + 0.0) / P;
  *xc = x1 + (x2 - x1) * t;
  *yc = y8687969 + (y2 - y8687969) * t;
  return true;
}
bool _in(double x, double y, int i, int j) {
  if (y > h + eps || y < -h - eps) return false;
  double l1 = (l[i] + 0.0) / (f - h) * (f - y);
  double r1 = (r[i] + 0.0) / (f - h) * (f - y);
  double l2 = (l[j] + 0.0) / (f - h) * (y + f);
  double r2 = (r[j] + 0.0) / (f - h) * (y + f);
  return (x > l1 - eps && x < r1 + eps && x > l2 - eps && x < r2 + eps);
}
double vect(double x1, double y8687969, double x2, double y2) {
  return x1 * y2 - x2 * y8687969;
}
bool l1(pair<double, double> a, pair<double, double> b) {
  return a.second < b.second - eps ||
         fabs(a.second - b.second) < eps && a.first < b.first;
}
bool l2(pair<double, double> a, pair<double, double> b) {
  return a.first < b.first - eps ||
         fabs(a.first - b.first) < eps && a.second < b.second;
}
bool l3(pair<double, double> a, pair<double, double> b) {
  return a.second > b.second + eps ||
         fabs(a.second - b.second) < eps && a.first < b.first;
}
bool l4(pair<double, double> a, pair<double, double> b) {
  return a.first > b.first + eps ||
         fabs(a.first - b.first) < eps && a.second < b.second;
}
double go(vector<pair<double, double> > w) {
  vector<pair<double, double> > u;
  int m = ((int)(w).size());
  int r = 0;
  double lx = w[0].first, rx = w[0].first, ly = w[0].second, ry = w[0].second;
  for (int i = 0; i < m; i++) {
    lx = min(lx, w[i].first);
    rx = max(rx, w[i].first);
    ly = min(ly, w[i].second);
    ry = max(ry, w[i].second);
  }
  sort((w).begin(), (w).end(), l1);
  for (int i = 0; i < m; i++)
    if (fabs(w[i].first - lx) < eps) u.push_back(w[i]);
  sort((w).begin(), (w).end(), l2);
  for (int i = 0; i < m; i++)
    if (fabs(w[i].second - ry) < eps) u.push_back(w[i]);
  sort((w).begin(), (w).end(), l3);
  for (int i = 0; i < m; i++)
    if (fabs(w[i].first - rx) < eps) u.push_back(w[i]);
  sort((w).begin(), (w).end(), l4);
  for (int i = 0; i < m; i++)
    if (fabs(w[i].second - ly) < eps) u.push_back(w[i]);
  double res = 0;
  u.push_back(u[0]);
  for (int i = 0; i + 1 < ((int)(u).size()); i++)
    res += vect(u[i + 1].first, u[i + 1].second, u[i].first, u[i].second);
  return fabs(res) / 2;
}
int main() {
  scanf("%d%d%d", &n, &h, &f);
  for (int i = 0; i < n; i++) scanf("%d%d", &l[i], &r[i]);
  double sum = 0;
  for (int i = 0; i < n; i++) {
    int l = ::l[i], r = ::r[i];
    double L = l, R = r;
    L = L / (f - h) * (f + h);
    R = R / (f - h) * (f + h);
    sum += 2 * h * (r - l + R - L);
    ::R[i] = R;
    ::L[i] = L;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      vector<pair<double, double> > v;
      v.push_back(make_pair(l[i], h));
      v.push_back(make_pair(r[i], h));
      v.push_back(make_pair(L[i], -h));
      v.push_back(make_pair(R[i], -h));
      v.push_back(make_pair(l[j], -h));
      v.push_back(make_pair(r[j], -h));
      v.push_back(make_pair(L[j], h));
      v.push_back(make_pair(R[j], h));
      double xc, yc;
      if (cross(0, f, l[i], h, 0, -f, l[j], -h, &xc, &yc))
        v.push_back(make_pair(xc, yc));
      if (cross(0, f, l[i], h, 0, -f, r[j], -h, &xc, &yc))
        v.push_back(make_pair(xc, yc));
      if (cross(0, f, r[i], h, 0, -f, l[j], -h, &xc, &yc))
        v.push_back(make_pair(xc, yc));
      if (cross(0, f, r[i], h, 0, -f, r[j], -h, &xc, &yc))
        v.push_back(make_pair(xc, yc));
      vector<pair<double, double> > w;
      for (int k = 0; k < ((int)(v).size()); k++)
        if (_in(v[k].first, v[k].second, i, j)) w.push_back(v[k]);
      if (((int)(w).size())) sum -= go(w);
    }
  printf("%.10f\n", sum);
  return 0;
}