Advertisement
Guest User

1

a guest
Oct 17th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. //ifstream cin("input.txt");
  8. //ofstream cout("output.txt");
  9. int main() {
  10. long long c, x, y, z, m, s, f, e, t;
  11. cin >> c >> x >> y >> z >> m >> s >> f >> e >> t;
  12. long long a = ceil((e + 1) * f / s) * m + t;
  13. long long n = ceil((c - x) / z);
  14. if (n < 0) {
  15. n = 0;
  16. }
  17. long long b = ceil((c + n * y) / s) * m;
  18. cout<<min(a, b);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement