let () = Scanf.scanf "%d\n" @@ fun n -> 
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  Printf.printf "%d\n" @@ Array.fold_left max min_int as_ - Array.fold_left min max_int as_
