(* O(n log(max xs)) *)
let n, x0 = Scanf.scanf " %d %d" @@ fun a b -> a, b
let xs = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0
let rec gcd a b = if b = 0 then a else gcd b @@ a mod b
let _ = Array.fold_left (fun g x -> gcd g @@ abs @@ x0 - x) 0 xs |> Printf.printf "%d\n"