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

int K;
double ans;
double L, R, P, T, E;

void dfs(double l, double r, int k, double p)
{
	//printf("##%f %f %d %f\n", l, r, k, p);
	double m = (l+r)/2;
	if (k==K)
	{
		if (fabs(m-T)<=E) ans += p;
		return;
	}
	if (l>=T-E && r<=T+E)
	{
		ans += p;
		return;
	}
	if (l>T+E) return;
	if (r<T-E) return;
	if (m >= T)
	{
		dfs(l, m, k+1, p*(1-P));
		dfs(m, r, k+1, p*P);
	}
	else
	{
		dfs(l, m, k+1, p*P);
		dfs(m, r, k+1, p*(1-P));
	}
}

int main()
{
	scanf("%d", &K);
	scanf("%lf%lf%lf%lf%lf", &L, &R, &P, &E, &T);
	//printf("%f %f\n", T-E, T+E);
	dfs(L, R, 0, 1);
	printf("%.7f\n", ans);
	return 0;
}