#lang racket (require math/number-theory) (define (solution) (define a (read)) (define b (read)) (define t (read)) (with-modulus 1000000007 (modexpt (/ (+ a b) 2) t))) (module+ main (solution)) (module+ test (with-input-from-string "2 4 1" solution) (with-input-from-string "2 4 1000000000000000000" solution))