#include #include #include #include int main() { std::vector length; std::vector time; for (int i = 0; i < 3; i++) { int num; std::cin >> num; length.push_back(num); } for (int i = 0; i < 3; i++) { int num; std::cin >> num; time.push_back(num); } std::sort(length.begin(), length.end()); int min = INT_MAX; do { int r = (length[0] * 2 + length[1] * 2) * time[0]; int b = (length[2] * 2 + length[1] * 2) * time[1]; int y = (length[0] * 2 + length[2] * 2) * time[2]; min = std::min(min, r + b + y); }while(std::next_permutation(length.begin(), length.end())); std::cout << min << std::endl; return 0; }