fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, a, b, c, d, e;
  6. cin >> n >> a >> b >> c >> d >> e;
  7. int t = 2*a;
  8. if (n >= 2 * c)
  9. t= min(t, 2*b);
  10. if (n >= 2 * e)
  11. t= min(t, 2*d);
  12. cout << t << endl;
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5312KB
stdin
10 30 20 3 10 6
stdout
40