Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <cmath>
- using namespace std;
- //ifstream cin("input.txt");
- //ofstream cout("output.txt");
- int main() {
- long long c, x, y, z, m, s, f, e, t;
- cin >> c >> x >> y >> z >> m >> s >> f >> e >> t;
- long long a = ceil((e + 1) * f / s) * m + t;
- long long n = ceil((c - x) / z);
- if (n < 0) {
- n = 0;
- }
- long long b = ceil((c + n * y) / s) * m;
- cout<<min(a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement