stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

#define loop(i, n) for (int i = 0; i < int(n); i++)

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

#define xloop(i, a, b) for (int i = int(a); i <= int(b); i++)

#define ALL(v) ((v).begin()), ((v).end())

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

  //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8018993459061845x):
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;

int main() {

	string s1, s2;

	cin >> s1 >> s2;

	long long int min = 0;

	for (long long int i = 0; i < s1.size(); i++) {

		if (s1[i] != s2[i]) min++;

	}

	cout << min;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

#define loop(i, n) for (int i = 0; i < int(n); i++)

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

#define xloop(i, a, b) for (int i = int(a); i <= int(b); i++)

#define ALL(v) ((v).begin()), ((v).end())

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

  //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7838882102136944x):
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main(){ string a, b; int ans = 0;

    cin >> a >> b;

    for (int i=0; i<a.length(); i++){

        if(a[i] != b[i]){

            ++ans;

        }

    }

    cout << ans << endl;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

#define loop(i, n) for (int i = 0; i < int(n); i++)

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

#define xloop(i, a, b) for (int i = int(a); i <= int(b); i++)

#define ALL(v) ((v).begin()), ((v).end())

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

  //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7833645814882184x):
#include <bits/stdc++.h>

using namespace std;

int main()

{

	string s,ss;

	cin>>s>>ss;

	int size=s.size(),ans=0;

	for (int i=0;i<size;i++)

	{

		if (s[i]!=ss[i])ans++;

	}cout<<ans<<"\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

#define loop(i, n) for (int i = 0; i < int(n); i++)

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

#define xloop(i, a, b) for (int i = int(a); i <= int(b); i++)

#define ALL(v) ((v).begin()), ((v).end())

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

  //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7750336020924775x):
#include <bits/stdc++.h>

using namespace std;



string s, t;

int cnt;



int main() {

	

	ios_base::sync_with_stdio(false);

	cin >> s >> t;

	cnt = 0;

	for(int i = 0; i < s.size(); i++) {

		if(s[i] != t[i]) cnt++;

	}

	cout << cnt;

}
// Slower C++ solution:
#include<iostream>

#include<string>

#include<algorithm>

#include<vector>

#include<iomanip>

#include<math.h>

#include<complex>

#include<queue>

#include<deque>

#include<stack>

#include<map>

#include<set>

#include<bitset>

#include<functional>

using namespace std;

#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )

#define rep(i,n) REP(i,0,n)

typedef long long ll;

typedef pair<int,int> pint;

typedef pair<ll,int> pli;

const int inf=1e9+7;

const ll longinf=1LL<<60 ;

const ll mod=1e9+7 ;



vector<int> v[101010];

priority_queue<int> ret[101010];

int ans[101010];



int dfs(int x,int p){

    ret[x].push(0);

    for(auto to:v[x]){

        if(to==p)continue;

        ret[x].push(dfs(to,x));

    }

    return ret[x].top()+1;

}



void dfs2(int x,int p){

    int res=ret[x].top();

    if(p!=-1){

        int y=ret[p].top();

        ret[p].pop();

        if(y!=res+1)ret[x].push(y+1);

        else ret[x].push(ret[p].top()+1);

        ret[p].push(y);

    }

    for(auto to:v[x]){

        if(to==p)continue;

        dfs2(to,x);

    }

    ans[x]=ret[x].top();

}



int main(){

    int n;

    cin>>n;

    rep(i,n-1){

        int a,b;

        cin>>a>>b;

        --a;--b;

        v[a].push_back(b);

        v[b].push_back(a);

    }

    dfs(0,-1);

    dfs2(0,-1);

    rep(i,n)cout<<2*(n-1)-ans[i]<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1411953841056877x):
#include<iostream>

#include<string>

#include<algorithm>

#include<vector>

#include<iomanip>

#include<math.h>

#include<complex>

#include<queue>

#include<deque>

#include<stack>

#include<map>

#include<set>

#include<bitset>

#include<functional>

using namespace std;

#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )

#define rep(i,n) REP(i,0,n)

typedef long long ll;

typedef pair<int,int> pint;

typedef pair<ll,int> pli;

const int inf=1e9+7;

const ll longinf=1LL<<60 ;

const ll mod=1e9+7 ;



vector<int> v[101010],ret[101010];

int ans[101010];



int dfs(int x,int p){

    ret[x].push_back(0);

    for(auto to:v[x]){

        if(to==p)continue;

        ret[x].push_back(dfs(to,x));

    }

    sort(ret[x].begin(),ret[x].end(),greater<>());

    return ret[x][0]+1;

}



void dfs2(int x,int p){

    int res=ret[x][0];

    if(x){

        if(ret[p][0]!=res+1)ret[x].push_back(ret[p][0]+1);

        else ret[x].push_back(ret[p][1]+1);

    }

    sort(ret[x].begin(),ret[x].end(),greater<>());

    for(auto to:v[x]){

        if(to==p)continue;

        dfs2(to,x);

    }

    ans[x]=ret[x][0];

}



int main(){

    int n;

    cin>>n;

    rep(i,n-1){

        int a,b;

        cin>>a>>b;

        --a;--b;

        v[a].push_back(b);

        v[b].push_back(a);

    }

    dfs(0,-1);

    dfs2(0,-1);

    rep(i,n)cout<<2*(n-1)-ans[i]<<endl;

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <vector>

using namespace std;



char s[200002];

vector<int> p[27];

int r[200002], tr[200002];



int main(){

  scanf("%s", s + 1); int L = strlen(s + 1);

  for(int i = 1; i <= L; i++) p[s[i] & 31].push_back(i);



  int o = 0;

  for(int i = 1; i <= 26; i++){

    int z = p[i].size();

    if(z & 1){ o++; r[p[i][z / 2]] = (L + 1) / 2; }

  }



  if(o > 1){ puts("-1"); return 0; }



  for(int i = 1, z = 1; i <= L; i++){

    if(r[i] == 0){

      r[i] = z; r[p[s[i] & 31].back()] = L + 1 - z;

      z++; p[s[i] & 31].pop_back();

    }

  }



  long long ans = 0;



  for(int i = L; i >= 1; i--){

    for(int x = r[i]; x > 0; x -= x & -x) ans += tr[x];

    for(int x = r[i]; x <= L; x += x & -x) tr[x]++;

  }



  printf("%lld\n", ans);

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.940936334728437x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;



char s[200002]; int cnt[28];

int gc[28];

char pre[100002], suf[100002];

int ptr[28], num[100002];

int tr[100002];



long long group(int L){

  long long res = 0;

  int oc = 0, tc = 0, pc = 0, sc = 0;



  for(int i = 1; i <= L; i++){

    int x = s[i] & 31, &g = gc[x], c = cnt[x]; g += 2;



    if(g < c + 1){ res += oc + tc; pre[++pc] = s[i]; }

    else if(g == c + 1){ res += tc; oc++; }

    else{ tc++; suf[++sc] = s[i]; }

  }



  return res;

}



int main(){

  scanf("%s", s + 1); int L = strlen(s + 1);

  for(int i = 1; i <= L; i++) cnt[s[i] & 31]++;



  int odd = 0;



  for(int i = 1; i <= 26; i++) if(cnt[i] & 1) odd++;



  if(odd > 1){ puts("-1"); return 0; }



  long long ans = group(L);



  int M = L / 2;



  reverse(suf + 1, suf + M + 1);



  for(int i = 1; i <= M; i++){

    char c = pre[i]; int &p = ptr[c & 31];

    while(suf[++p] != c);



    num[p] = i;

  }



  for(int i = M; i >= 1; i--){

    int x = num[i];

    for(int y = x - 1; y > 0; y -= y & -y) ans += tr[y];

    for(; x <= M; x += x & -x) tr[x]++;

  }



  printf("%lld\n", ans);

  return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

#include<algorithm>

#include<map>

#include<cmath>

using namespace std;

double cnt;

double p,t;

int K; 

double e;

double ll,rr;

double dfs(double l,double r,int k,double tl,double tr)

{

     double mid=(l+r)/2.00;

     if(l>tl-1e-12&&r<tr+1e-12)

     return 1.0;

     if(r<tl+1e-12||l>tr-1e-12)

     return 0.0;

    if(k==K)

    {

     if(mid<tr+1e-12&&mid>tl-1e-12)

      return 1.0;

     else return 0.0;

    }

    double pp;

    if(mid>=t-1e-12) pp=1.00-p;

    else pp=p;

    return pp*dfs(l,mid,k+1,tl,tr)+(1-pp)*dfs(mid,r,k+1,tl,tr);

    

}

int main()

{

  //freopen("aaa.txt","r",stdin);

  //freopen("bbb.txt","w",stdout);

  while(cin>>K>>ll>>rr)

  {    

    cin>>p>>e>>t;   

    double kk=dfs(ll,rr,0,t-e,t+e);

    printf("%.12lf\n",kk);

  }

}

// Faster C++ solution for the same problem (measured speedup: 5.002224059468546x):
#include <stdio.h>

#include <cstring>



double P, E, T;



double fabs(double x){

    if(x < 0) x = -x;

    return x;

}



double dfs(int k, double pro, double L, double R){

    if(k == 0){

        double mid = (L + R) / 2;

        if(fabs(mid - T) <= E) return pro;

        return 0;

    }

    if(T + E < L || T - E > R) return 0;

    double ans = 0;

    double mid = (L + R) / 2;

    if(fabs(R - T) <= E && fabs(T - L) <= E) return pro;

    if(mid >= T){

        ans += dfs(k - 1, pro * (1 - P), L, mid);

        ans += dfs(k - 1, pro * P, mid, R);

    }

    else{

        ans += dfs(k - 1, pro * P, L, mid);

        ans += dfs(k - 1, pro * (1 - P), mid, R);

    }

    return ans;

}

int main(){

    //freopen("input.txt", "r", stdin);

    int K;

    double L, R;

    scanf("%d %lf %lf", &K, &L, &R);

    scanf("%lf %lf %lf", &P, &E, &T);

    double ans = dfs(K, 1.0, L, R);

    printf("%lf\n", ans);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<cmath>

#include<map>

#include<vector>

#include<queue>

#include<string>

#include<csetjmp>

#include<bitset>

#include<cassert>

#include<cctype>

#include<complex>

#include<ctime>

#include<deque>

#include<fstream>

#include<functional>

#include<iomanip>

#include<limits>

#include<list>

#include<numeric>

#include<set>

#include<sstream>

#include<stack>

#include<utility>

using namespace std;

#define PI 3.1415926535897932384626433832795028

#define N 30

#define M 10010

#define inf 2000000000

typedef long long LL;

int k;

double p, e, t, ans;

void dfs(int cur, double l, double r, double temp) {

	if (l > t+e || r < t-e) return ;

	if (l >= t-e && r <= t+e) {

		ans += temp;

		return ;

	}

	double mid = (l+r)/2;

	if (cur == k) {

		if (fabs(mid - t) < e) ans += temp;

		return ;

	}

	if (mid > t) {

		dfs(cur+1, l, mid, temp*(1-p));

		dfs(cur+1, mid, r, temp*p);

	}

	else {

		dfs(cur+1, mid, r, temp*(1-p));

		dfs(cur+1, l, mid, temp*p);

	}

}

int main() {

	double l, r;

	while (scanf("%d%lf%lf", &k, &l, &r) != EOF) {

		scanf("%lf%lf%lf", &p, &e, &t);

		ans = 0;

		dfs (0, l, r, 1.0);

		printf("%.6lf\n", ans);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.90085990342203x):
#include <stdio.h>

#include <cstring>



double P, E, T;



double fabs(double x){

    if(x < 0) x = -x;

    return x;

}



double dfs(int k, double pro, double L, double R){

    if(k == 0){

        double mid = (L + R) / 2;

        if(fabs(mid - T) <= E) return pro;

        return 0;

    }

    if(T + E < L || T - E > R) return 0;

    double ans = 0;

    double mid = (L + R) / 2;

    if(fabs(R - T) <= E && fabs(T - L) <= E) return pro;

    if(mid >= T){

        ans += dfs(k - 1, pro * (1 - P), L, mid);

        ans += dfs(k - 1, pro * P, mid, R);

    }

    else{

        ans += dfs(k - 1, pro * P, L, mid);

        ans += dfs(k - 1, pro * (1 - P), mid, R);

    }

    return ans;

}

int main(){

    //freopen("input.txt", "r", stdin);

    int K;

    double L, R;

    scanf("%d %lf %lf", &K, &L, &R);

    scanf("%lf %lf %lf", &P, &E, &T);

    double ans = dfs(K, 1.0, L, R);

    printf("%lf\n", ans);

    return 0;

}
// Slower C++ solution:
#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

#include <cmath>

#include <cstdlib>

#include <algorithm>

#include <iostream>

using namespace std;

#define INF 0x7fffffff

#define Max 200000

#define eps 1e-10



double l, r, p, e, t, ans;

int c;



void dfs (double L, double R, int days, double pp)

{

	if (R < (t - e) || L > (t + e))

		return ;

	if (L >= t - e && R <= t + e)

	{

		ans += pp;

		return ;

	}

	double mid = (L + R) / 2.0;

	if (days > c) 

	{

		if (abs(mid - t) <= e) ans += pp;

		return ;

	}

	if (mid >= t)

	{

		dfs (L, mid, days + 1, pp * (1 - p));

		dfs (mid, R, days + 1, pp * p);

	}

	else

	{

		dfs (mid, R, days + 1, pp * (1 - p));

		dfs (L, mid, days + 1, pp * p);

	}

}



int main ()

{

	int i, j;

	while (scanf ("%d%lf%lf", &c, &l, &r) == 3)

	{

		scanf ("%lf%lf%lf", &p, &e, &t);

		ans = 0;

		dfs (l, r, 1, 1);

		printf ("%.20lf\n", ans);

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.904722535197823x):
#include <stdio.h>

#include <cstring>



double P, E, T;



double fabs(double x){

    if(x < 0) x = -x;

    return x;

}



double dfs(int k, double pro, double L, double R){

    if(k == 0){

        double mid = (L + R) / 2;

        if(fabs(mid - T) <= E) return pro;

        return 0;

    }

    if(T + E < L || T - E > R) return 0;

    double ans = 0;

    double mid = (L + R) / 2;

    if(fabs(R - T) <= E && fabs(T - L) <= E) return pro;

    if(mid >= T){

        ans += dfs(k - 1, pro * (1 - P), L, mid);

        ans += dfs(k - 1, pro * P, mid, R);

    }

    else{

        ans += dfs(k - 1, pro * P, L, mid);

        ans += dfs(k - 1, pro * (1 - P), mid, R);

    }

    return ans;

}

int main(){

    //freopen("input.txt", "r", stdin);

    int K;

    double L, R;

    scanf("%d %lf %lf", &K, &L, &R);

    scanf("%lf %lf %lf", &P, &E, &T);

    double ans = dfs(K, 1.0, L, R);

    printf("%lf\n", ans);

    return 0;

}
// Slower C++ solution:
#include <stdio.h>

#include <cmath>

#include <algorithm>

#include <cfloat>

#include <stack>

#include <queue>

#include <vector>

#include <string.h>

typedef long long int ll;

typedef unsigned long long int ull;

#define BIG_NUM 2000000000

#define MOD 1000000007

#define EPS 0.000000001

using namespace std;



double ans = 0,P,E,T;

int K;



void recursive(double R,double L,double probability,int count){



	if(L < T-E || R > T+E)return;



	if(count == K){

		if(fabs(T-(R+L)/2.0) <= E){

			ans += probability;

		}

		return;

	}



	double H = (R+L)/2.0;



	double right_R,right_L,wrong_R,wrong_L;



	if(H > T){



		right_R = R,right_L = H;

		recursive(right_R,right_L,probability*(1-P),count+1);



		wrong_R = H,wrong_L = L;

		recursive(wrong_R,wrong_L,probability*P,count+1);



	}else{



		right_R = H,right_L = L;

		recursive(right_R,right_L,probability*(1-P),count+1);



		wrong_R = R,wrong_L = H;

		recursive(wrong_R,wrong_L,probability*P,count+1);

	}

}



int main(){



	double first_R,first_L;



	scanf("%d %lf %lf",&K,&first_R,&first_L);

	scanf("%lf",&P);

	scanf("%lf",&E);

	scanf("%lf",&T);



	recursive(first_R,first_L,1.0,0);



	printf("%.6lf\n",ans);



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.2366378636752262x):
#include <stdio.h>

#include <cmath>

#include <algorithm>

#include <cfloat>

#include <stack>

#include <queue>

#include <vector>

#include <string.h>

typedef long long int ll;

typedef unsigned long long int ull;

#define BIG_NUM 2000000000

#define MOD 1000000007

#define EPS 0.000000001

using namespace std;



double ans = 0,P,E,T;

int K;



void recursive(double R,double L,double probability,int count){



	if(L < T-E || R > T+E)return;



	if(count == K){

		if(fabs(T-(R+L)/2.0) <= E){

			ans += probability;

		}

		return;

	}else if(R >= T-E && L <= T+E){

		ans += probability;

		return;

	}



	double H = (R+L)/2.0;



	double right_R,right_L,wrong_R,wrong_L;



	if(H > T){



		right_R = R,right_L = H;

		recursive(right_R,right_L,probability*(1-P),count+1);



		wrong_R = H,wrong_L = L;

		recursive(wrong_R,wrong_L,probability*P,count+1);



	}else{



		right_R = H,right_L = L;

		recursive(right_R,right_L,probability*(1-P),count+1);



		wrong_R = R,wrong_L = H;

		recursive(wrong_R,wrong_L,probability*P,count+1);

	}

}



int main(){



	double first_R,first_L;



	scanf("%d %lf %lf",&K,&first_R,&first_L);

	scanf("%lf",&P);

	scanf("%lf",&E);

	scanf("%lf",&T);



	recursive(first_R,first_L,1.0,0);



	printf("%.6lf\n",ans);



	return 0;

}
// Slower C++ solution:
#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

#define mod 1000000007

using namespace std;



int n;

long long dp1[300010],dp2[300010],a[300010],sum1,sum2;



priority_queue<long long,vector<long long>,greater<long long> > q;

priority_queue<long long> q2;



int main()

{

	//fuck!!!

	scanf("%d",&n);

	memset(dp1,0,sizeof(dp1));

	memset(dp2,0x3f,sizeof(dp2));

	for(int i=1;i<=3*n;i++)

	{

		scanf("%lld",&a[i]);

	}

	for(int i=1;i<=n;i++)

	{

		q.push(a[i]);

		sum1+=a[i];

	}

	dp1[n]=sum1;

	for(int i=n+1;i<=3*n;i++)

	{

		if(q.top()<a[i])

		{

			sum1-=q.top();

			sum1+=a[i];

			q.pop();

			q.push(a[i]);

		}

		dp1[i]=sum1;

	}

	for(int i=3*n;i>2*n;i--)

	{

		q2.push(a[i]);

		sum2+=a[i];

	}

	dp2[2*n+1]=sum2;

	for(int i=2*n;i>=1;i--)

	{

		if(q2.top()>a[i])

		{

			sum2-=q2.top();

			sum2+=a[i];

			q2.pop();

			q2.push(a[i]);

		}

		dp2[i]=sum2;

	}

	long long ans=-0x3f3f3f3f3f3f3f3f;

	for(int i=n;i<=2*n;i++)

	{

//		printf("%d %lld %lld\n",i,dp1[i],dp2[i]);

		ans=max(ans,dp1[i]-dp2[i+1]);

	}

	printf("%lld\n",ans);

}

// Faster C++ solution for the same problem (measured speedup: 6.33919117422818x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<string>

#include<cmath>

#include<algorithm>

#include<map>

#include<vector>

#include<queue>

#define LL long long

using namespace std;

const int MaxN = 1e5;

const LL Inf = 1LL << 60;



priority_queue<LL> q2;

priority_queue<LL,vector<LL>,greater<LL> > q1;

LL sum[3 * MaxN + 5],cas[3 * MaxN + 5],a[3 * MaxN + 5];

LL sum2[3 * MaxN + 5],cas2[3 * MaxN + 5];



int main()

{

	LL pp,ans;

	int n;

	while(~scanf("%d",&n)){

		ans = -Inf;

		sum[0] = 0;cas[n] = 0;

		for(int i = 1;i <= n;i++) {

			scanf("%lld",&a[i]);

			sum[i] = sum[i - 1] + a[i];

			q1.push(a[i]);

		}

		for(int i = n + 1;i <= 2 * n;i++) {

			scanf("%lld",&a[i]);

			sum[i] = sum[i - 1] + a[i];

			q1.push(a[i]);

			pp = q1.top();

			cas[i] = cas[i - 1] + pp;

			q1.pop();

		}

		for(int i = 2 * n + 1;i <= 3 * n;i++){

			scanf("%lld",&a[i]);

		}

		sum2[3 * n + 1] = 0;cas2[2 * n + 1] = 0;

		for(int i = 3 * n;i >= 2 * n + 1;i--){

			sum2[i] = sum2[i + 1] + a[i];

			q2.push(a[i]);

		}

		for(int i = 2 * n;i >= n + 1;i--){

			sum2[i] = sum2[i + 1] + a[i];

			q2.push(a[i]);

			pp = q2.top();

			cas2[i] = cas2[i + 1] + pp;

			q2.pop();

		}

		for(int i = n;i <= 2 * n;i++){

			pp = sum[i] - cas[i] - sum2[i + 1] + cas2[i + 1];

			ans = max(pp,ans);

		}

		printf("%lld\n",ans);

	}

	return 0;

}