fork download
  1.  
  2. (define ncases (read))
  3.  
  4. (define (read-four-nums)
  5. (let ((a (read)) (b (read))
  6. (c (read)) (d (read)))
  7. `(,a ,b ,c ,d)))
  8.  
  9. (define (show-res lst)
  10. (if (null? lst) '()
  11. (begin
  12. (show-res (cdr lst))
  13. (display (if (= 1 (car lst))
  14. "Escape is possible."
  15. "Box cannot be dropped."))
  16. (newline))))
  17.  
  18.  
  19. (define rslt '())
  20.  
  21. (do ((i 1 (+ i 1)))
  22. ((> i ncases) '())
  23. (let* ((d (read-four-nums))
  24. (a (car d)) (b (cadr d)) (x (caddr d)) (y (cadddr d)))
  25. (set! rslt
  26. (if (>= (* a b) (* x y))
  27. (cons 1 rslt) (cons 0 rslt)))))
  28.  
  29. (show-res rslt)
  30. (exit)
Success #stdin #stdout 0.01s 7908KB
stdin
4
100 50 105 9
10 10 8 8
8 8 10 10
8 8 10 10
stdout
Escape is possible.
Escape is possible.
Box cannot be dropped.
Box cannot be dropped.