fork(3) download
  1. #include<bits/stdc++.h>
  2. #define int long long
  3. using namespace std;
  4.  
  5. signed main()
  6. {
  7. // k = exp / cost;
  8. int l, r, x, y, k;
  9. bool ans = 0;
  10. cin >> l >> r >> x >> y >> k;
  11. for (int i = x; i <= y; i++)
  12. {
  13. if (l <= i * k && i * k <= r)
  14. {
  15. ans = 1;
  16. }
  17. }
  18. if (ans)
  19. {
  20. cout << "YES";
  21. }
  22. else
  23. {
  24. cout << "NO";
  25. }
  26. return 0;
  27. }
Time limit exceeded #stdin #stdout 5s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty