SHARE
TWEET

1

a guest Oct 17th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top