(define (vector-update v x y i j) (let1 ix (+ (* i i) (* j j)) (cond [(<= x ix y) (let1 vl (vector-ref v ix) (cond [(or (zero? i) (zero? j)) (vector-set! v ix (+ 2 vl))] [else (vector-set! v ix (+ 4 vl))]))]))) (define (solve x y) (let ([v (make-vector (+ y 1) 0)]) (let loop ([i 0] [j 0]) (cond [(> (* i i) y) #t] [(> (* j j) y) (loop (+ i 1) 0)] [else (vector-update v x y i j) (loop i (+ j 1))])) (apply max (map (^i (vector-ref v i)) (iota (- y x -1) x))))) (define (main args) (let* ([x (read)] [y (read)]) (print (solve x y))) 0)