import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    int K; double R, L;
    double P, E, T;
    scanf("%d %lf %lf\n", &K, &R, &L);
    scanf("%lf\n", &P);
    scanf("%lf\n", &E);
    scanf("%lf\n", &T);

    bool C(double x) {
        return abs(x - T) <= E;
    }

    double dfs(double lb, double ub, int k) {
        double l = T - E, r = T + E;
        if (ub < l) return 0;
        if (lb > r) return 0;
        if (l <= lb && ub <= r) return 1;
        double mid = (lb + ub) / 2;
        if (k == 0) return cast(double)(C(mid));
        double ret;
        if (T < mid) {
            ret = P * dfs(mid, ub, k - 1) + (1 - P) * dfs(lb, mid, k - 1);
        } else {
            ret = P * dfs(lb, mid, k - 1) + (1 - P) * dfs(mid, ub, k - 1);
        }
        //writeln([k, lb, ub], " -> ", ret);
        return ret;
    }

    writefln("%.10f", dfs(R, L, K));
}