fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long double lb;
  4. typedef long double ll;
  5. lb a, A, B, x, y;
  6. int t;
  7.  
  8.  
  9. int main(){
  10. ios_base::sync_with_stdio(0);
  11. cout.tie(0);
  12. cin.tie(0);
  13. cin >> t;
  14. while(t--){
  15. cin >> x >> y >> a;
  16. a += 0.5;
  17. string ans = "";
  18. long long L = 1, R = 1e9;
  19. bool printed = false;
  20. if(x >= a){
  21. cout << "NO" << endl;
  22. continue;
  23. }
  24. while(L <= R){
  25. ll mid = (L + R) / 2;
  26. A = mid * x + mid * y;
  27. B = (mid + 1) * x + mid * y;
  28. if(A >= a and B < a){
  29. cout << "YES" << endl;
  30. printed = true;
  31. break;
  32. }
  33. if(B >= a and A < a){
  34. cout << "NO" << endl;
  35. printed = true;
  36. break;
  37. }
  38. if(A < a and B < a) L = mid + 1;
  39. if(A > a and B > a){
  40. R = mid - 1;
  41. ans = "YES";
  42. }
  43. }
  44. if(ans.size() and !printed) cout << ans << endl;
  45. }
  46. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty