#define _USE_MATH_DEFINES #include #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// vector L(3); vector R(3); vector Len(3); rep(i,3){cin>>L[i];} rep(i,3){cin>>R[i];} Len[0] = (L[0]+L[1])*2; Len[1] = (L[1]+L[2])*2; Len[2] = (L[2]+L[0])*2; sort(Len.begin(), Len.end() ); sort(R.begin(), R.end() ); int ans=400000; int temp; do{ temp = 0; rep(i,3){ temp += Len[i]*R[i]; } ans = min(ans,temp); }while( next_permutation(R.begin(),R.end() ) ); P(ans); return 0; }