Scanf.scanf "%d %d %d" (fun x y z -> let x, y = min x y, max x y in let d = min z (y - x) in let x = x + d + (z - d) / 2 in Printf.printf "%d\n" x )