fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // Function to check if the box can be dropped on a single tile
  6. bool canDropBox(int A, int B, int X, int Y) {
  7. return (X <= A && Y <= B) || (X <= B && Y <= A);
  8. }
  9.  
  10. int main() {
  11. int T;
  12. cin >> T; // Number of test cases
  13.  
  14. // Iterate through each test case
  15. for (int i = 0; i < T; ++i) {
  16. int A, B, X, Y;
  17. cin >> A >> B >> X >> Y; // Read tile dimensions (A, B) and box dimensions (X, Y)
  18.  
  19. // Check if the box can be dropped on a single tile
  20. if (canDropBox(A, B, X, Y)) {
  21. cout << "Escape is possible." << endl;
  22. } else {
  23. cout << "Box cannot be dropped." << endl;
  24. }
  25. }
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0.01s 5308KB
stdin
2
10 8 8
10
10
12
23
8 8 10
stdout
Escape is possible.
Box cannot be dropped.