#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long LL;

const double EPS = 1e-8;
const int N = 20005;

inline bool eq(double x, double y) {
	return fabs(x-y) < EPS;
}

inline double cmp(double x, double y) {
	return eq(x, y) ? 0 : x-y;
}

inline double sqr(double x) {
	return x*x;
}

inline int sgn(double x) {
	return eq(x, 0) ? 0 : x > 0 ? 1 : -1;
}

int n, a, b, c, l, r, x[N], y[N];
vector<double> v;

inline LL xmul(LL x1, LL y1, LL x2, LL y2) {
	return x1*y2-x2*y1;
}

inline double func(double x) {
	return (a*x+b)*x+c;
}

inline double func2(double x) {
	return 2*a*x+b;
}

inline double func3(double x) {
	return sqrt(sqr(func2(x))+1);
}

bool find_root(double a, double b, double c, double* root) {
	double d = b*b-4*a*c;
	if(cmp(d, 0) <= 0) return false;
	d = sqrt(d);
	root[0] = (-d-b)/a*0.5;
	root[1] = ( d-b)/a*0.5;
	return true;
}

void gao(int x1, int y1, int x2, int y2) {
	if(x1 == x2) {
		double yi = func(x1);
		if(y1 > y2) swap(y1, y2);
//		if(cmp(yi, y1) > 0 && cmp(yi, y2) < 0) {
		if(y1 < yi - EPS && yi < y2 - EPS) {
			v.push_back(x1);
			while(1);
			if(cmp(x1, yi) == 0) while(1);
		}
	} else {
		double K = (y2-y1)/(double)(x2-x1);
		double B = y1-K*x1;
		double root[2];
		if(find_root(a, b-K, c-B, root)) {
			if(x1 > x2) swap(x1, x2);
			for(int i = 0; i < 2; ++i) {
				if(x1 < root[i] - EPS && root[i] < x2 - EPS) {
					v.push_back(root[i]);
				}
			}
		}
	}
}

double length(double x1, double x2) {
	x1 = func2(x1);
	x2 = func2(x2);
	double k1 = sqrt(sqr(x1)+1);
	double k2 = sqrt(sqr(x2)+1);
	return (x2*k2-x1*k1 + log((x2+k2)/(x1+k1)))/4/a;
}

int xxx(LL xa,LL ya,LL xb,LL yb){
	double t = xa * (double) yb - xb * ya;
	if(xb * ya == xa * yb  && fabs(t)<0.6 )
		return 0;
	if(t>0)return 1;
	return -1;
}
bool ddd(LL xa,LL ya,LL xt,LL yt){
	if(ya * yt > -xa *(double)xt)return 1;
	return 0;
}

int main() {
//	LL INF = 0x7FFFFFFFFFFFFFFFLL;
//	printf("%lld\n", INF);
	while(1==scanf("%d", &n)) {
		scanf("%d%d%d%d%d", &a, &b, &c, &l, &r);
		for(int i = 0; i < n; ++i) {
			scanf("%d%d", x+i, y+i);
		}
		if(n < 3) { puts("0.00"); continue; }
		x[n] = x[0]; y[n] = y[0];
		v.clear();
		for(int i = 0; i < n; ++i) {
			gao(x[i], y[i], x[i+1], y[i+1]);
			if(eq(func(x[i]), y[i])) {
				LL x1 = x[(i-1+n)%n] - x[i];
				LL y1 = y[(i-1+n)%n] - y[i];
				LL x2 = x[i+1] - x[i];
				LL y2 = y[i+1] - y[i];
				int coef = a < 0 ? -1 : 1;
				int sgn1 = xxx(x1, y1, 1, 2LL*a*x[i]+b) * coef;
				int sgn2 = xxx(x2, y2, 1, 2LL*a*x[i]+b) * coef;
//				int sgn1 = !prod1 ? 0 : (prod1 > 0 ? 1 : -1);
//				int sgn2 = !prod2 ? 0 : (prod2 > 0 ? 1 : -1);
				bool side1 = sgn1 >= 0;
				bool side2 = sgn2 >= 0;
/*				if(sgn1 * sgn2 == 0) {
					LL tx = 2*a*x[i], ty=-1;
					if(a>0){
						tx=-tx;
						ty=-ty;
					}
					if(sgn1 && ddd(x1,y1,tx,ty) || sgn2 && ddd(x2,y2,tx,ty)){
						v.push_back(x[i]);
					}
				} else if(sgn1 * sgn2 < 0) {
					v.push_back(x[i]);
				}*/
				if(side1 ^ side2) {
					v.push_back(x[i]);
				}
			}
		}
		sort(v.begin(), v.end());
		if(v.size() & 1) while(1);
		double ans = 0;
		for(size_t i = 0; i+1 < v.size(); i+=2) {
			double li = max(v[i], (double)l);
			double ri = min(v[i+1], (double)r);
			if(li < ri) {
				ans += length(li, ri);
			}
		}
		printf("%.2f\n", ans);
	}
}
