Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. inline void end() {
  7.     cout << endl;
  8.     system("pause");
  9. }
  10.  
  11. int main() {
  12.     int d, u, v, z, s;
  13.     cin >> d >> u >> v >> z >> s;
  14.     int res2 = d / (u + v) - (bool)(!(d % (u + v)));
  15.     int res1 = -1;
  16.     if (res2 >= s)
  17.         res1 = res2 - s;
  18.     else if (res2 >= z)
  19.         res1 = 0;
  20.     cout << res1 << " " << res2;
  21.     end();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement