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



using namespace std;



int n;

long double d,x,ans;



int main()

{

	cin>>n>>d>>x;

	for(int i=n;i;i--)

	{

		ans+=d+(i*2-1)*x/2;

		d=(d*(i*2+2)+x*5)/(i*2);

		x=(i*2+4)*x/(i*2);

	}

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

} 

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

#include <cstdlib>

#include <algorithm>



typedef long long LL;



double ans;



double calc(LL n,double sum)

{

	if(n == 1) return sum / (2 * n);

	else return calc(n - 1, sum - sum / (n * n)) + sum / (2 * n);

}

int main()

{

	LL n, d, x;

	

	scanf("%lld%lld%lld", &n, &d, &x);

	printf("%.10lf", calc(n, (2 * d + (2 * n - 1) * x) * n));

	return 0;

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

using namespace std;



double Cal(int n, double d, double x)

{

	if(n == 1)

	{

		return (d + d + x) / 2;

	}

	return Cal(n - 1, d * (n + 1) / n + x * 5 / (n * 2), x * (n + 2) / n) + (d + d +(n * 2 - 1) * x) / 2;

}

int n;

double d, x;





int main()

{

	scanf("%d%lf%lf", &n, &d, &x);

	printf("%.15f\n", Cal(n, d, x));

	return 0;

}

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

#include <cstdlib>

#include <algorithm>



typedef long long LL;



double ans;



double calc(LL n,double sum)

{

	if(n == 1) return sum / (2 * n);

	else return calc(n - 1, sum - sum / (n * n)) + sum / (2 * n);

}

int main()

{

	LL n, d, x;

	

	scanf("%lld%lld%lld", &n, &d, &x);

	printf("%.10lf", calc(n, (2 * d + (2 * n - 1) * x) * n));

	return 0;

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

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

#define per(i,a,b) for(int i=a;i>=b;i--)

#define gpf(...) fprintf(stderr,__VA_ARGS__)

using namespace std;

typedef long long ll;



int n, d1, x;



long double calc(int len, long double a1, long double d){

	if (len == 0) return 0;

	long double res = (a1 + d * len - d * 0.5);

	long double ta1, td;

	ta1 = (a1 * (2 * len + 2) - d * len * 2 + d + (2 * len + 4) * d) / ((long double)len * 2);

	td = d * (len * 2 + 4) / ((long double)len * 2);

	res = res + calc(len - 1, ta1, td);

	return res;

}



int main(){

	scanf("%d%d%d", &n, &d1, &x);

	printf("%.10LF\n", calc(n, (long double)d1, (long double)x));

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include <stdlib.h>

#include <string.h>

#include <iostream>

using namespace std;



int n, d, x;



double calc(int n, double d, double x)

{

	if(n == 1)

		return d + x / 2.0;

	return d + x * n - x * 0.5 + calc(n - 1, d * (n - 1) / n + (d + 2 * x) / (2 * n) + (3 * d + 3 * x) / (2 * n), x * (n * 2 + 4) / (2 * n));

}



int main()

{

	scanf("%d%d%d", &n, &d, &x);

	printf("%.12lf\n", calc(n, d, x));



	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include<iomanip>

using namespace std;

long double ans=0;

void calc(long long n,long double sum)

{

	ans+=sum/(2*n);

	if(n==1)

		return;

	calc(n-1,sum-sum/(n*n));

}



int main()

{

	long long n,d,x;

	cin>>n>>d>>x;

	long double sum=(d+d+(2*n-1)*x)*n;

	calc(n,sum);

	cout<<fixed<<setprecision(15)<<ans<<endl;

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include <stdlib.h>

#include <string.h>

#include <iostream>

using namespace std;



int n, d, x;



double calc(int n, double d, double x)

{

	if(n == 1)

		return d + x / 2.0;

	return d + x * n - x * 0.5 + calc(n - 1, d * (n - 1) / n + (d + 2 * x) / (2 * n) + (3 * d + 3 * x) / (2 * n), x * (n * 2 + 4) / (2 * n));

}



int main()

{

	scanf("%d%d%d", &n, &d, &x);

	printf("%.12lf\n", calc(n, d, x));



	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

using namespace std;



int n;

long double d,x;

long double ans;



int main()

{

	double _d,_x;

	scanf("%d%lf%lf",&n,&_d,&_x);

	d=_d,x=_x;

	for (int i=n;i>0;i--)

	{

		ans+=d+(i*2-1)*x/2;

		d=(d*(i*2+2)+x*5)/(i*2);

		x=(i*2+4)*x/(i*2);

	}

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

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#define rep(i,a,n) for(int _tmp=n,i=a;i<=_tmp;++i)

#define dep(i,a,n) for(int _tmp=n,i=a;i>=_tmp;--i)

#define re(i,a,n) for(int _tmp=n,i=a;i<_tmp;++i)

#define fec(i,a) for(__typeof a.begin() i=a.begin();i!=a.end();++i)

#define For(i,v,u) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])

#define si(x) (int)x.size()

#define pb push_back

#define mp make_pair

#define mt make_tuple

#define X first

#define Y second

#define inf 1000000000

using namespace std;

template<class T> inline void read(T&x){char c;bool fu=0;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x*=-1;}

template<class T> inline void read(T&x,T&y){read(x);read(y);}

template<class T> inline void read(T&x,T&y,T&z) {read(x,y);read(z);}

template<class T> inline void MAX(T&x,T y){if(x<y)x=y;}

template<class T> inline void MIN(T&x,T y){if(x>y)x=y;}

typedef long long ll;

typedef pair<int,int> pii;

typedef tuple<int,int,int> tiii;

//head

double ans,n,d,t;

void work(double n,double d,double t){

	if(n==0)return;

	ans+=(d+d+(2*n-1)*t)/2.;

	double dd=((2*n+2.)*d+5*t)/2./n,tt=(t*(4.+2*n)/2./n);

	work(n-1,dd,tt);

}

int main() {

	scanf("%lf%lf%lf",&n,&d,&t);

	work(n,d,t);

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

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include <iostream>

#include <algorithm>

#include <cstring>

#define N 200010

using namespace std;



long double ans = 0;

long double a[N], d[N];



int main() {

	int n, d1, x;

	scanf("%d%d%d", &n, &d1, &x);

	a[0] = d1; d[0] = x;

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

		a[i + 1] = ((2.0 * (n - i) + 2) * a[i] + 5.0 * d[i]) / (2.0 * (n - i));

		d[i + 1] = (2.0 * (n - i) + 4) * d[i] / 2.0 / (n - i);

//cout << a[i] << ' ' << d[i] << endl;

		ans += (2.0 * (n - i) * a[i] + ((n - i) * (2.0 * (n - i) - 1)) * d[i]) / (2.0 * (n - i));

	}

	printf("%.15f\n", (double)ans);

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include<algorithm>

#include<cstring>

#include<iostream>

#include<cstdio>

#include<cstdlib>

using namespace std;



int N; double D,X;



inline int gi()

{

	char ch; int ret = 0,f = 1;

	do ch = getchar(); while (!(ch >= '0'&&ch <= '9')&&ch != '-');

	if (ch == '-') f = -1,ch = getchar();

	do ret = ret*10+ch-'0',ch = getchar(); while (ch >= '0'&&ch <= '9');

	return ret*f;

}



inline double calc(int n,double d,double x)

{

	if (n == 0) return 0;

	else return calc(n-1,(2*d+2*n*d+5*x)/(2*n),(2*x)/n+x)+d+(2*n-1)*x/2;

}



int main()

{

	//freopen("F.in","r",stdin);

	//freopen("F.out","w",stdout);

	N = gi(); D = gi(); X = gi();

	cout << fixed << setprecision(10) << calc(N,D,X) << endl;

	return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

using namespace std;



int n;

double d0, d;



int main() {

	double ans = 0.0;

	cin >> n >> d0 >> d;

	n = n << 1;

	d0 -= d;

	for( ; n >= 2; n -= 2 ) {

		ans += d0 + d * (n + 1) / 2.0;

		double nd0 = d0 + (2 * d0 + 3 * d) / n;

		double nd = d + (4 * d) / n;

		d0 = nd0, d = nd;

	}

	cout << setprecision(20) << fixed << ans << endl;

}






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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

using namespace std;

double solve(int n, double d, double x) {

	if (n == 0) return 0;

	double res = d + (2 * n - 1) * x / 2;

	double dd = ((2 * n + 2) * d + 5 * x) / 2 / n;

	double xx = (n + 2) * x / n;

	return res + solve(n - 1, dd, xx);

}

int main() {

	int n, d, x;

	scanf("%d%d%d", &n, &d, &x);

	double ans = solve(n, d, x);

	printf("%.10f\n", ans);

}




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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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



using namespace std;



int n;

long double d,x,ans;



int main()

{

	cin>>n>>d>>x;

	for(int i=n;i;i--)

	{

		ans+=d+(i*2-1)*x/2;

		d=(d*(i*2+2)+x*5)/(i*2);

		x=(i*2+4)*x/(i*2);

	}

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

} 

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

using namespace std;



double Cal(int n, double d, double x)

{

	if(n == 1)

	{

		return (d + d + x) / 2;

	}

	return Cal(n - 1, d * (n + 1) / n + x * 5 / (n * 2), x * (n + 2) / n) + (d + d +(n * 2 - 1) * x) / 2;

}

int n;

double d, x;





int main()

{

	scanf("%d%lf%lf", &n, &d, &x);

	printf("%.15f\n", Cal(n, d, x));

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

using namespace std;

long double ans=0;

void calc(long long n, long double sum)

{

  ans+=sum/(2*n);

  if (n==1) return;

  calc(n-1,sum-sum/n/n);

}

int main()

{

  long long n,d,x;

  cin>>n>>d>>x;

  long double sum=(d+d+(2*n-1)*x)*n;

  calc(n,sum);

  cout<<fixed<<setprecision(15)<<ans<<endl;

  return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include <iomanip>

using namespace std;



typedef long long LL;

typedef long double LD;



LD calc(int n, LD d1, LD d) {

	if (n == 1) {

		return d1 + d / 2;

	}

	return d1 + (n * 2 - 1) * d / 2 + calc(n - 1, d1 + (2 * d1 + 5 * d) / n / 2, d + d * 2 / n);

}



int main() {

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	

	int n;

	LD d1, x;

	cin >> n >> d1 >> x;

	cout << fixed << setprecision(10) << calc(n, d1, x) << endl;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

}
// Slower C++ solution:
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>

using namespace std;



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

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



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

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

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;



const int MAX = 2000 + 47;

const double EPS = 1e-9;









int main()

{

    

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

    //ios::sync_with_stdio(false); cin.tie(0);

    

    int n, d, x;

    cin >> n >> d >> x;

    double D = (2 * d + (2 * n - 1) * 1LL * x) * .5;

    double ans = .0;

    RFOR(i, n+1, 1)

    {

        ans += D;

        D += D / i;

    }

    cout << fixed << setprecision(11) << ans << endl;

    return 0;

}








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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

}
// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include<unordered_set>

#include<complex>

using namespace std;



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

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



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

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

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



const int MOD = 1000 * 1000 * 1000 + 7;

const int MAX = 1000 * 1000 + 47;



int main()

{

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

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

	ios::sync_with_stdio(false); cin.tie(0);

	int n;

	double d0, x;

	cin >> n >> d0 >> x;



	double ans = 0;

	RFOR(k, n + 1, 1)

	{

		//cout << d0 << " " << x << endl;

		ans += (2 * d0 + x * (2 * k - 1)) * k / (2.0 * k);

		if (k == 1) break;



		double x1 = (2 * x + k * x) / k;

		double d1 = (2 * (k + 1) * d0 + 5 * x) / (2.0 * k);

		x = x1;

		d0 = d1;

	}



	cout << fixed << setprecision(12) << ans << endl;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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

#include<cstdio>

#define db double

using namespace std;



int n;

db x,d,ans,tmp;



int main()

{

	int i,j;

	cin>>n>>d>>x;

	for(;n;n--)

	{

		ans+=(d*2.0+(db)(2*n-1)*x)/2.0;

		tmp=d;

		d+=d/(db)n+5.0*x/(db)(2*n);

		x+=2.0*x/(db)n;

//		cout<<ans<<" "<<d<<" "<<x<<endl;

	}

	printf("%.10f",ans);

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int n;

double d,x;

int main()

{

	scanf("%d %lf %lf",&n,&x,&d);

	int m=2*n;

	double ans=0;

	while(m)

	{

		ans+=(2.0*x+(1.0*m-1.0)*d)/2.0;

		x=((1.0*m+2.0)*x+5.0*d)/(1.0*m);

		d=(1.0*m+4.0)*d/(1.0*m);

		m-=2;

	}

	printf("%.10f\n",ans);

	return 0;

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



using namespace std;



int n,k,t,l;

double a,p,ans;



int main()

{

	scanf("%d%lf%lf",&n,&a,&p);

	a-=p;

	t=2*n;

	l=n;

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

	{

		ans+=(double)(a*t+p*t*(t+1)/2)/t;

		a=a+a/l+3*p/(2*l);

		p=p+2*p/l;

		l--;

		t-=2;

	}

	printf("%.9lf",ans);

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

typedef long long ll;

int main()

{

	ll n;

	double x,d;

	scanf("%lld%lf%lf",&n,&x,&d);

	double ans=0;

	ll m=2*n;

	while(m){

		ans+=(2*x+(m-1)*d)*1.0/2;

        x=((m+2)*x+5*d)*1.0/m;

        d=(m+4)*d*1.0/m;

        m-=2;

	}

	printf("%.10f",ans);

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

using namespace std;

typedef long long ll;



const int N = (int)1e5 + 10;

const double eps = 1e-8;



template <typename T> inline T gcd(T a, T b) { a = abs(a), b = abs(b); while ( b ) { a %= b; swap(a, b); } return a; }

vector <pair <int, int> > adj[N + 7];





int main() {

	ios_base::sync_with_stdio(0);

	cin.tie(0); cout.tie(0);

	int n, m;

	cin >> n >> m;

	vector <pair <ll, ll> > arr(n);

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

		cin >> arr[i].first >> arr[i].second;

	}

	sort(arr.begin(), arr.end());

	int total = 0;

	ll taka = 0;

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

		int temp = m - total;

		if ( arr[i].second <= temp ) {

			total += arr[i].second;

			taka += (arr[i].second * arr[i].first);

		} else if ( arr[i].second > temp ) {

			taka += ((m - total) * arr[i].first);

			total = m;

		}

		if ( total >= m ) break;

	}

	cout << taka << endl;

    return 0;

}


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

using namespace std;



#define endl "\n"

#define f first

#define s second

#define pb push_back

#define pii pair<int,int>

#define pll pair<ll,ll>

#define ll long long

#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);



const ll M = 998244353;

const int N = 1e6+5;

const ll INF = 1e18;



ll n,m;

pll a[N];



int main() {

	faster;

	cin>>n>>m;

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

		cin>>a[i].f>>a[i].s;

	}

	sort(a+1,a+1+n);

	ll cnt = 0,ans = 0;

	int i = 1;

	while (cnt < m) {

			//cout<<cnt<<' ';

		ll q = min(m - cnt,a[i].s);

		ans+= q*(a[i].f);

		cnt+=q;

		i++;

	}

	cout<<ans;



    return 0;

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

using namespace std;

typedef long long ll;



const int N = (int)1e5 + 10;

const double eps = 1e-8;



template <typename T> inline T gcd(T a, T b) { a = abs(a), b = abs(b); while ( b ) { a %= b; swap(a, b); } return a; }

vector <pair <int, int> > adj[N + 7];





int main() {

	ios_base::sync_with_stdio(0);

	cin.tie(0); cout.tie(0);

	int n, m;

	cin >> n >> m;

	vector <pair <ll, ll> > arr(n);

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

		cin >> arr[i].first >> arr[i].second;

	}

	sort(arr.begin(), arr.end());

	int total = 0;

	ll taka = 0;

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

		int temp = m - total;

		if ( arr[i].second <= temp ) {

			total += arr[i].second;

			taka += (arr[i].second * arr[i].first);

		} else if ( arr[i].second > temp ) {

			taka += ((m - total) * arr[i].first);

			total = m;

		}

		if ( total >= m ) break;

	}

	cout << taka << endl;

    return 0;

}


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

using namespace std;

long long n , m;

pair <long,long> p[1000001];

int main(){

    cin >> n >> m;

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

        cin >> p[i].first >> p[i].second;

    }

    sort(p + 1, p + 1 + n);

    long long ans = 0;

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

        if(m < p[i].second){

            ans += m * p[i].first;

            m = 0;

        }

        else{

            ans += p[i].first * p[i].second;

            m -= p[i].second;

        }

    }

    cout << ans;

    return 0;

}