(define (System.out.println x) (begin (display x) (newline) ) ) (let ( (foo (read)) ) (let loop((X (read)) (Y (read)) (Ans -1)) (if (eof-object? X) (System.out.println Ans) (if (> (- Y X) 0) (if (and (>= Ans 0) (not (= Ans (- Y X)))) (System.out.println -1) (loop (read) (read) (- Y X)) ) (System.out.println -1) ) ) ) )