#include #include #include using namespace std; int main() { int l[3]; cin >> l[0] >> l[1] >> l[2]; int r, b, y; cin >> r >> b >> y; int minLength = std::numeric_limits::max(); for (int heightIndex = 0; heightIndex < 3; ++heightIndex) { for (int widthIndex = 0; widthIndex < 3; ++widthIndex) { if (heightIndex == widthIndex) { continue; } int depthIndex = (3 - (heightIndex + widthIndex) % 3) % 3; int rLength = (l[heightIndex] + l[depthIndex]) * 2 * r; int bLength = (l[heightIndex] + l[widthIndex]) * 2 * b; int yLength = (l[widthIndex] + l[depthIndex]) * 2 * y; minLength = min(minLength, rLength + bLength + yLength); } } cout << minLength << endl; return 0; }