fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. void solve() {
  6.  
  7. double cost;
  8.  
  9. cin >> cost;
  10.  
  11. double y1, y2, y3, y4;
  12.  
  13. cin >> y1 >> y2 >> y3 >> y4;
  14.  
  15. double n;
  16.  
  17. cin >> n;
  18.  
  19. int Y1 = floor(n * y1);
  20. int Y2 = floor(n * y2);
  21. int Y3 = floor(n * y3);
  22. int Y4 = floor(n * y4);
  23.  
  24. cout << (Y1 * 12 + Y2 * 10 + Y3 * 7 + Y4 * 5 <= cost ? "YES" : "NO") << endl;
  25.  
  26. }
  27.  
  28. int main() {
  29.  
  30. ios_base::sync_with_stdio(false);
  31. cin.tie(0);
  32.  
  33. int n = 2;
  34.  
  35. while(n--) {
  36.  
  37. solve();
  38.  
  39. }
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0.01s 5280KB
stdin
4000
0.5 0.2 0.1 0.2
400
6000
0.1 0.1 0.45 0.35
2000
stdout
YES
NO