stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	long long int a,ans;

    double b;

	cin>>a>>b;

	ans=a*b;

	cout<<ans;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

int main(){

int a,b;

scanf("%d%d",&a,&b);

printf("%d\n",a*b);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	long long int ans;

    long double a,b,s;

	cin>>a>>b;

	s=a*b;

	ans=(long long int) s;

	cout<<ans;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main(){

int a,b;

scanf("%d%d",&a,&b);

printf("%d\n",a*b);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



signed main()

{

	int a,b;

	cin>>a>>b;

	cout<<a*b<<endl;

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

	int a,b;

	cin>>a>>b;

	cout<<a*b<<endl;

	

	return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cstring>

using namespace std;

typedef long long  ll;

int main()

{

	ll a,b;

	cin>>a>>b;

	cout<<a*b;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int a,b;

	cin>>a>>b;

	cout<<a*b;

	return 0;

} 

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int a,b;

	cin>>a>>b;

	cout<<a*b;//

 } 

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
 

#include<bits/stdc++.h>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

#define ll  long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define main() int main()

#define ff1(i,n) for(int i=1;i<=n;++i)

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

#define pi acos(-1.0)

#define ms(a, x) memset(a, x, sizeof(a))

#define lowbit(x) ((x)&(-(x)))

#define pb push_back

#define binarycount __builtin_popcount(x)

#define tr t[root]

#define lson t[root << 1]

#define rson t[root << 1 | 1]

#define fir first

#define sec second

#define debug(x) cout<<x<<'\n'

#define sa(a) scanf("%d", &a)

#define sab(a, b) scanf("%d%d", &a, &b)

#define pa(a) printf("%d",a)

#define pab(a,b) printf("%d%d",a,b)

#define pii pair<int,int>

using namespace std;



#define maxn 1000005

const int inf = 0x3f3f3f3f;

const int mod = 1e9+7;

const double eps = 1e-8;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

ll powmod(ll a,ll b){

    ll ans = 1, pow = a%mod;

    while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; }

    return ans%mod;

}

main()

{  

    ll a,b;

    cin>>a>>b;

    cout<<a*b<<endl;

}

 

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    int a,b,c;

    cin>>a>>b;

    c=a*b;

    cout<<c<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long int a,b;

    cin>>a>>b;

    cout<<a*b<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

int main()

{

    int a, b;

    scanf("%d %d", &a, &b);

    int sum = a*b;

    printf("%d\n", sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main()

{

    int A,B;

    cin >> A >> B;

    cout << A*B << endl;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

using namespace std;

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    printf("%d\n",a*b);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define ll long long

#define endl '\n'

using namespace std;

#define N 100007

#define mod 1000000000000000000

#define pb push_back

vector<ll> v[N];

#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);

int main()

{

    ll a,b;

    cin>>a>>b;

    cout<<a*b;

    

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define ll long long

#define endl '\n'

using namespace std;

//#define N 100007

//#define mod 1000000000000000000

//#define pb push_back

// vector<ll> v[N];

#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);

int main()

{

    ll a,b;

    cin>>a>>b;

    cout<<a*b;

    

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define int long long

using namespace std;

int a, b, c, x, y, ans = 1e18 + 13;

int32_t main () {

    cin >> a >> b >> c >> x >> y;

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

	int resx = max(0ll, x - i / 2), resy = max(0ll, y - i / 2);

	ans = min(ans, i * c + resx * a + resy * b);

    }

    cout << ans << endl;

}


// Optimized solution to the same problem (faster):
#include <vector>

#include <algorithm>

#include <stdio.h>

#include <iostream>

#include <queue>

#include <string>

#include <set>

#include <map>

#include <unordered_set>

#include <unordered_map>

using namespace std;

int main(){

    int a,b,c,x,y;

    scanf("%d %d %d %d %d\n",&a,&b,&c,&x,&y);

    int sum=a*x+b*y;

    int d=min(x,y);

    //cout<<sum<<endl;

    sum=min(sum,d*2*c+(x-d)*a+(y-d)*b);

    //cout<<sum<<endl;

    d=max(x,y);

    sum=min(sum,d*2*c);

    printf("%d\n",sum);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define print cout <<

#define printl(s) cout << s << endl;

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

using ll = long long;



const ll modseed = pow(10,9) + 7;



template <typename T>

vector<T> getValues(int num){

    vector<T> values(num);

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

        cin >> values.at(i);

    }

    return values;

}



int main(){

  int A,B,C,X,Y;

  cin >> A >> B >> C >> X >> Y;

  ll ans = 0;

  int ar=0;

  int br=0;

  int cr=0;

  for(int c=0;c<=100000;c++){

    int a = max(0, X-c);

    int b = max(0, Y-c);

    ll result = c * 2 * C + a*A+b*B;

    if(ans==0){

      ans = result;

    }else{

      ans = min(ans, result);

    }

  }

  printl(ans);

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



#define printl(s) cout << s << endl;

#define print(s) cout << s << endl; return 0;

#define yes cout << "Yes" << endl; return 0;

#define no cout << "No" << endl; return 0;

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

#define rep2(i,n) for (int i = 1; i < (n)+1; ++i)

using ll = long long;



const ll modseed = pow(10,9) + 7;



template <typename T>

vector<T> getValues(ll num){

    vector<T> values(num);

    for(ll i=0;i<num;i++){

        cin >> values.at(i);

    }

    return values;

}



string S;

ll A,B,C,K,N,X,Y,cnt;



int main(){

  cin >> A >> B >> C >> X >>Y;

  rep(c,max(X,Y)*2){

    int a,b;

    a = max(0LL,X-c/2);

    b = max(0LL,Y-c/2);

    if(c==0){

      cnt = a*A+b*B+c*C;

    }else{

      cnt = min(cnt,a*A+b*B+c*C);

    }

  }

  print(cnt);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <climits>

#include <cmath>

using namespace std;

int main() {

  int A, B, C, X, Y, min = INT_MAX;

  cin >> A >> B >> C >> X >> Y;

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

    int v = 2 * C * i + max(0, X - i) * A + max(0, Y - i) * B;

    if (v < min) min = v;

  }

  cout << min << endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <climits>

#include <cmath>

using namespace std;

int main() {

  int A, B, C, X, Y, Z = 0, total = 0;

  cin >> A >> B >> C >> X >> Y;

  if (A + B < 2 * C) { // AピザとBピザを別々の方が安い

    total = X * A + Y * B;

  } else { // ABピザの方が安い

    Z = min(X, Y);

    total = 2 * C * Z;

    int restX = max(0, X - Z);

    int restY = max(0, Y - Z);

    if (restX > 0) {

      if (A < 2 * C) { // Aピザを別に買った方が安い

        total += A * restX;

      } else { // ABピザの方が安い

        total += 2 * C * restX;

      }

    }

    if (restY > 0) {

      if (B < 2 * C) {

        total += B * restY;

      } else {

        total += 2 * C * restY; 

      }

    }

  }

  cout << total << endl;

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#include <math.h>

#include <iomanip>

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int INF=1001001001;

vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){

  vector<pair<int64_t,int64_t>>p;

  for(int64_t i=2;i*i<=x;i++){

    int cnt=0;

    if(x%i==0){

    while(x%i==0){cnt++;x/=i;}

    p.push_back(make_pair(i,cnt));

    }

  }

  if(x!=1){p.push_back(make_pair(x,1));}

  return p; 

}





int main() {

  int A,B,C,X,Y;

  cin>>A>>B>>C>>X>>Y;

  int ans=1000000007;

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

      int sum=2*C*i+A*max(X-i,0)+B*max(Y-i,0);

      ans=min(ans,sum);

  }

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#include <math.h>

#include <iomanip>

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int64_t INF=1e18+1;

const int mod = 1000000007;



int main() {

  int A,B,C,X,Y;

  cin>>A>>B>>C>>X>>Y;

  C*=2;

  int ab=0;

  if(X==Y){ab=X;}

  else if(X>Y){ab=Y;}

  else{ab=X;}

  int ans=min({A*X+B*Y,(X-ab)*A+(Y-ab)*B+C*ab,C*max(X,Y)});

  cout<<ans<<endl;

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main(){

  int a, b, c, x, y;

  cin >> a >> b >> c >> x >> y;

  int tmp, ans = 1000000000;

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

    tmp = c*2*i + a*max(0, x-i) + b*max(0, y-i);

    ans = min(ans, tmp);

  }

  cout << ans << endl;



}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define dum(x) cout<<#x<<'='<<x<<endl

#define ll long long

using namespace std;



int main() {

  int a, b, c, x, y;

  cin >> a >> b >> c >> x >> y;

  int ans = 1000000000;

  for (int i = 0; i <= 200000; i+= 2) {

    int tmp = i * c + max(0, x - i / 2) * a + max(0, y - i / 2) * b;

    ans = min(ans, tmp);

  }

  cout << ans << endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<vector>

#include<string>

#include<algorithm>

#include<cmath>

#include<queue>

#include<climits>

#include<set>

#include<map>

#include<stack>

#define ll long long

using namespace std;



int main() {

	ll a, b, c, x, y, ans;

	cin >> a >> b >> c >> x >> y;

	ans =LLONG_MAX;

	for (ll i = 0; i <= 200000; i++) {

		ans = min(ans,i * c + max(x - i/2,(ll)0)*a + max(y - i/2,(ll)0)*b);

	}

	cout << ans << endl;







}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>

#include <string>

#include <algorithm>

#include <cmath>

#include <queue>

#include <climits>

#include <set>

#include <map>

#include <stack>

#include <iomanip>

#include <tuple>

#define ll long long

using namespace std;

/*階乗*/

ll factorial(ll n){

    if(n==0){

        return 1;

    }

    else{

        return n*factorial(n-1);

    }

}



/* ユークリッドの互除法 最大公約数*/

/*ll gcd(ll a, ll b) {

	ll r;

	r = a % b;

	while (r != 0) {

		a = b;

		b = r;

		r = a % b;

	}

	return b;

}

*/





/*最小公倍数*/

/*

ll lcm(ll a,ll b){

	return a/gcd(a,b)*b;

}

*/



/*二点間の距離*/

double dist(pair<double,double> a,pair<double,double> b){

	return sqrt(pow((a.first - b.first) ,2) + pow((a.second - b.second),2));

}



//繰り返し自乗法

double ism(double aa,ll p){

    double ap=aa;

    double ans=1;

    while(p>0){

        //cout<<"p="<<p<<",ap="<<ap<<endl;

        if(p&1){//奇数が真

            ans*=ap;

        }

        p/=2;

        ap=ap*ap;

    }

    return ans;



}

//繰り返し自乗法(アマリトリバージョン)

ll ismm(ll aa,ll p,ll m){

    ll ap=aa;

    ll ans=1;

    while(p>0){

        //cout<<"p="<<p<<",ap="<<ap<<endl;

        if(p&1){//奇数が真

            ans=(ans*ap)%m;    

        }

        p/=2;              

        ap=(ap*ap)%m;

    }

    return ans;



}

/*

ll solve(ll i,ll m,vector<ll>t,ll n){

    if(m==0){

        return 1;

    }

    if(i>=n){

        return 0;

    }

    

    

    cout<<i+1<<" "<<m<<endl;

    cout<<i+1<<" "<<m-t[i]<<endl;

    ll res=solve(i+1,m,t,n)||solve(i+1,m-t[i],t,n);

    return res;

}

*/



//小数点12桁

struct all_init

{

    all_init()

    {

        cout << fixed << setprecision(12);

    }

} All_init;





int main()

{

    ll a,b,c,x,y,t=0;

    cin>>a>>b>>c>>x>>y;

    if(min(x,y)==x){

        t+=2*min(x,y)*c+abs(max(x,y)-min(x,y))*b;

    }

    else if(min(x,y)==y){

        t+=2*min(x,y)*c+abs(max(x,y)-min(x,y))*a;

        //cout<<2*min(x,y)*c<<endl;

        //cout<<abs(max(x,y)-min(x,y))*a<<endl;;

    }

    





    cout<<min({a*x+b*y,2*max(x,y)*c,t})<<endl;

    





}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <algorithm>

#include <cassert>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <vector>



#include <limits.h>



using namespace std;



typedef long long ll;



template<class T>

inline bool chmax(T &a, T b) {

    if(a < b) {

        a = b;

        return true;

    }

    return false;

}



template<class T>

inline bool chmin(T &a, T b) {

    if(a > b) {

        a = b;

        return true;

    }

    return false;

}



const int INF = INT_MAX / 2;



int main(void) {

    int A, B, C, X, Y;

    cin >> A >> B >> C >> X >> Y;



    int ans = INF;

    for (int num_c = 0; num_c <= 200000; num_c += 2) {

        int num_a = max(0, X - num_c / 2);

        int num_b = max(0, Y - num_c / 2);

        int cand = num_a * A + num_b * B + C * num_c;

        chmin(ans, cand);

    }



    cout << ans << endl;



    return 0;

}


// Optimized solution to the same problem (faster):
#include <algorithm>

#include <cassert>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <vector>



#include <limits.h>



using namespace std;



typedef long long ll;



template<class T>

inline bool chmax(T &a, T b) {

    if(a < b) {

        a = b;

        return true;

    }

    return false;

}



template<class T>

inline bool chmin(T &a, T b) {

    if(a > b) {

        a = b;

        return true;

    }

    return false;

}



const int INF = INT_MAX / 2;



int main(void) {

    int A, B, C, X, Y;

    cin >> A >> B >> C >> X >> Y;



    int ans = INF;



    // buy only A and B pizza

    chmin(ans, A * X + B * Y);



    // buy only C pizza

    chmin(ans, max(X, Y) * 2 * C);



    // buy A, B, and C pizza

    if (X < Y) {

        int acc = 2 * C * X;

        acc += (Y - X) * B;

        chmin(ans, acc);

    } else {

        int acc = 2 * C * Y;

        acc += (X - Y) * A;

        chmin(ans, acc);

    }



    cout << ans << endl;



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <math.h>

using namespace std;



int main() {

    int A, B, C, X, Y;

    cin >> A >> B >> C >> X >> Y;

    int min_cost = 2 * 5000 * 100000;

    for (int num_C = 0; num_C / 2 <= 100000; num_C++) {

        int num_A = 0, num_B = 0;

        if (num_C / 2 < X) {

            num_A = X - num_C / 2;

        }

        if (num_C / 2 < Y) {

            num_B = Y - num_C / 2;

        }

        int sum = A * num_A + B * num_B + C * num_C;

        min_cost = fmin(min_cost, sum);

    }

    cout << min_cost << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



// マクロ

// forループ

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)

#define REPD(i,n) for(ll i=n-1;i>=0;i--)

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

#define FORD(i,a,b) for(ll i=(a);i>=(ll)(b);i--)

// xにはvectorなどのコンテナ

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

#define SIZE(x) ((ll)(x).size())

#define MAX(x) *max_element(ALL(x))

#define MIN(x) *min_element(ALL(x))

// 出力

#define PRINT(x) cout<<(x)<<endl

#define PRINTA(x,n) REP(i,n)PRINT(x[i])

// 定数

#define INF 1000000000000 // 10^12

#define MOD 1000000007 // 10^9+7

// 略記

#define PB push_back

#define MP make_pair



int A, B, C, X, Y;



int main() {

    cin >> A >> B >> C >> X >> Y;

    int min_cost = 0;

    if (A + B < 2 * C) {

        min_cost += A * X + B * Y;

    }

    else if (X < Y) {

        min_cost += 2 * C * X;

        if (B < 2 * C) {

            min_cost += B * (Y - X);

        }

        else {

            min_cost += 2 * C * (Y - X);

        }

    }

    else {

        min_cost += 2 * C * Y;

        if (A < 2 * C) {

            min_cost += A * (X - Y);

        }

        else {

            min_cost += 2 * C * (X - Y);

        }

    }

    PRINT(min_cost);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



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

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

#define all(x) (x).begin(),(x).end()



inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}



typedef long long ll;



const int maxi = 1e5;

 

int main(){

    int A, B, C, X, Y;

    cin >> A >> B >> C >> X >> Y;



    int ans = 1e9;

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

        ans = min(ans, i*2*C + max(0, X-i)*A + max(0, Y-i) * B);

    }



    cout << ans << endl;





    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



typedef long long llint;



int main() {

  int a, b, c, x, y;

  cin >> a >> b >> c >> x >> y;

  int ans = 0;

  if (c * 2 < a + b) {

    int m = min(x, y);

    x -= m, y -= m;

    ans += 2 * c * m;

  }

  if (c * 2 < a) {

    ans += 2 * c * x;

    x = 0;

  }

  if (c * 2 < b) {

    ans += 2 * c * y;

    y = 0;

  }

  ans += a * x + b * y;

  cout << ans << endl;



  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main()

{

	int a,b,c,x,y;

	cin>>a>>b>>c>>x>>y;

	

	vector<long long> dp((int)1e5+1);

	for(int i=0;i<=(int)1e5;i++)

	{

		dp[i] = max(0,x-i)*a + max(0,y-i)*b + i*2*c*1LL;

	}

	cout<<*min_element(dp.begin(),dp.end());

	return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

using namespace std;

int main()

{

    int a, b, c, x, y, com, ext,tot=0;

    scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);

    if (y > x)

    {

        int t = x;

        x = y;

        y = t;

        t = a;

        a = b;

        b = t;

    }

    com=y;ext=x-y;

    if(2*c<a+b)tot+=com*c*2;else tot+=com*(a+b);

    if(2*c<a)tot+=ext*2*c;else tot+=ext*a;\

    printf("%d",tot);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
using namespace std;

#include <iostream>

#include <string>

#include <cstdio>

#include <algorithm>

#include <vector>

#include <climits>

#define all(x) (x).begin(),(x).end()



void solve(){



}

int main(){

    int a,b,c,x,y;

    cin >> a >> b >> c >> x >> y;



    int adda, addb, sum;

    int minp = INT_MAX;

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

        minp = min(i * 2 * c + max(0,x-i) * a + max(0,y-i) * b, minp);

    }



    cout << minp << endl;







}


// Optimized solution to the same problem (faster):
using namespace std;

#include <iostream>

#include <string>

#include <cstdio>

#include <algorithm>

#include <vector>

#include <cmath>

#include <functional>

#include <cassert>

#define all(x) (x).begin(),(x).end()



void solve(){



}

int main(){

    int a,b,c,x,y;

    cin >> a >> b >> c >> x >> y;

 

    int simple_sum = x * a + y * b;

    int c_sum = max(x, y) * c * 2;

 

    int ab_amount;

    int a_amount;

    int b_amount;

 

    if (x < y){

 

        //int xquot = x / 2;

        //int yquot = y / 2;

 

        //int amod = x % 2;

        //int bmod = y - 2 * xquot;

        int bmod = y - x;



 

        ab_amount = c * x * 2;

        a_amount = a * 0;

        b_amount = b * bmod;

 

    } else {

 

        int amod = x - y;

 

        ab_amount = c * y * 2;

        a_amount = a * amod;

        b_amount = b * 0;

 

    }

    int opt_sum = ab_amount + a_amount + b_amount;

 

    cout << min(min(simple_sum, c_sum), opt_sum) << endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

/**

AHMED;HASSAN;SAEED

*/

using namespace std;



int main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    long long a,b,c,x,y;

    cin>>a>>b>>c>>x>>y;

    long long mn=min(x,y);

    long long ans1=0;

    long long ans2=0;

    if(x*a+y*b>=mn*2*c){

        ans1+=mn*c*2;

        if(x>y){

            long long sn=x-y;

            ans1+=min(sn*a,sn*2*c);

        }

        else{

            long long sn=y-x;

            ans1+=min(sn*b,sn*2*c);

        }

    }

    ans2+=x*a+y*b;

    if(ans1!=0)

    cout << min(ans1,ans2) << endl;

    else

    cout << ans2 << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;



int a,b,c,x,y;



int main(){

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

	scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);

	int com = min(x,y);//a b棋盘公共的部分 com套a+b 

	int sum = 0; 

	if(a+b>=c*2){//套装更优惠 

		sum += com*c*2; 

		if(x>=y){

			if(a>=c*2){

				sum += (x-y)*2*c;

			}else{

				sum += (x-y)*a;

			}	

		}else{

			if(b>=c*2){

				sum += (y-x)*2*c;

			}else{

				sum += (y-x)*b;

			}

		}

	}else{//单买更优惠 

		sum = x*a + y*b; 

	}

	printf("%d\n", sum);

	

	return 0;

}

// Fastest known solution for this problem: