#include #include #include #include #include #include #define LL long long #define REP(i, n) for(int i = 0;i < (int)(n);i++) #define ALL(x) (x).begin(),(x).end() #define EPS 1e-10 #define LESSEQ(a,b) ((a)<((b)+EPS)) #define LESS(a,b) (((a)+EPS)<(b)) using namespace std; int K; double R,L, P, E, T; double solve(double l, double r, int depth) { depth--; double h = (l+r)/2.0; //printf("%.9lf %.9lf\n", l, r); if(depth <= 0) { if(LESSEQ(abs(h - T), E)) { return 1; } return 0; } if(LESSEQ(T-E,l) && LESSEQ(l,T+E) && LESSEQ(T-E, r) && LESSEQ(r, T+E)) { //必ず収まるとき return 1; } if(LESS(l,T-E) && LESS(r, T-E)) { //小さすぎる return 0; } if(LESS(T+E, l) && LESS(T+E, r)) { //大きすぎる return 0; } double res = 0.0; if(LESS(h, T)) { //RをHで更新が正しい res += (1-P)*solve(l,h,depth); res += P*solve(h,r,depth); } else { //LをHで更新が正しい res += (1-P)*solve(h,r,depth); res += P*solve(l,h,depth); } return res; } int main(){ while(cin >> K >> R >> L) { cin >> P; cin >> E; cin >> T; printf("%.10f\n", solve(L, R, K+1)); } return 0; }