func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:16777216 )   using namespace std;   template <class T>   inline void checkmin(T &a, T b) {     if (a > b) a = b;   }   template <class T>   inline void checkmax(T &a, T b) {     if (a < b) a = b;   }   const int oo = 1 << 30;   const double eps = 1e-7;   const int N = 512;   const int M = 1;   const long long P = 10000000097ll;   int sgn(double x) { return (x > eps) - (x < -eps); }   int fcmp(double a, double b) { return sgn(a - b); }   double sqr(double x) { return x * x; }   struct Point {     double x, y;     Point() {}     Point(double a, double b) : x(a), y(b) {}     Point operator+(const Point &p) const { return Point(x + p.x, y + p.y); }     Point operator-(const Point &p) const { return Point(x - p.x, y - p.y); }     Point operator*(double d) const { return Point(x * d, y * d); }     double operator*(const Point &p) const { return x * p.y - y * p.x; }     Point operator/(double d) const { return Point(x / d, y / d); }     double norm() const { return sqrt(x * x + y * y); }     Point rot(double alpha) const {       return Point(x * cos(alpha) - y * sin(alpha),                    x * sin(alpha) + y * cos(alpha));     }     void cin() { scanf( %lf %lf , &x, &y); }     void cout(char *s =  p =  ) const { printf( %s %f %f , s, x, y); }   };   struct Line {     Point a, b;     Line() {}     Line(const Point &p, const Point &q) : a(p), b(q) {}     bool para(const Line &lin) const {       Point u, v;       u = b - a;       v = lin.b - lin.a;       return sgn(u * v) == 0;     }     bool l_to_s(const Line &seg) const {       return sgn((b - a) * (seg.a - a)) * sgn((b - a) * (seg.b - a)) < 0;     }     bool s_to_s(const Line &seg) const {       return l_to_s(seg) && seg.l_to_s(*this);     }     Point l_on_l(const Line &lin) const {       double s1, s2;       s1 = (lin.a - a) * (lin.b - a);       s2 = (lin.b - b) * (lin.a - b);       return (a * s2 + b * s1) / (s1 + s2);     }     int l_to_p(const Point &p) const { return sgn((b - a) * (p - a)); }   };   Point ar[N][5];   Point br[N][5];   Point tmple[2][N];   Point *x, *y;   double h, f;   int n;   double ans;   double area(Point *p, int pn) {     int i, j, k;     double ans = 0;     for (i = 1; i < pn; i++) ans += (p[i] - p[0]) * (p[i + 1] - p[0]);     if (pn < -11) {       for (i = 0; i < (pn); i++) printf( %.3f %.3f-->  , p[i].x, p[i].y);       puts(  );     }     return ans;   }   void read() {     int i, j, k;     double a, b;     double fix, low;     ans = 0;     scanf( %d , &n);     scanf( %lf %lf , &h, &f);     fix = f / (f - h);     low = (f + h) / (f - h);     for (i = 0; i < (n); i++) {       scanf( %lf %lf , &a, &b);       ar[i][0] = Point(a * fix, 0);       ar[i][1] = Point(b * fix, 0);       ar[i][2] = Point(b, h);       ar[i][3] = Point(a, h);       ar[i][4] = ar[i][0];       br[i][0] = Point(a * fix, 0);       br[i][1] = Point(b * fix, 0);       br[i][2] = Point(b * low, h);       br[i][3] = Point(a * low, h);       br[i][4] = br[i][0];       ans += area(ar[i], 4) + area(br[i], 4);     }   }   void cut(Point *p) {     int xn, yn;     int i, j, k;     int ii, jj;     Line lin, seg;     for (i = 0; i < (n); i++) {       for (j = 0; j < (5); j++) x[j] = p[j];       xn = 4;       for (j = 0; j < (4); j++) {         lin = Line(ar[i][j], ar[i][j + 1]);         yn = 0;         for (ii = 1; ii <= xn; ii++) {           seg = Line(x[ii - 1], x[ii]);           if (lin.l_to_s(seg)) y[yn++] = lin.l_on_l(seg);           if (lin.l_to_p(x[ii]) >= 0) y[yn++] = x[ii];         }         y[yn] = y[0];         swap(x, y);         swap(xn, yn);       }       ans -= area(x, xn);     }   }   void sub() {     int i, j, k;     x = tmple[0];     y = tmple[1];     for (i = 0; i < (n); i++) cut(br[i]);   }   int main() {     int T, _ = 0;     read();     sub();     printf( %.6f n , ans);     return 0;   }   