fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int D,U,V,Z,S;
  6. cin >> D >> U >> V >> Z >> S;
  7. int C = D / (V + U);
  8. if (C < Z)
  9. cout << -1 << " " <<C;
  10. else if (C < S) {
  11. cout << Z << " " << C;
  12. }
  13. else cout << Z << " " << S;
  14.  
  15.  
  16.  
  17.  
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 15240KB
stdin
20 2 2 13 33
stdout
-1 5