Scanf.scanf "%d" (fun n -> let rec gcd a b = if b = 0 then a else gcd b (a mod b) in let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in let rec loop i acc = if i = n then acc else loop (i + 1) (gcd acc a.(i)) in let g = loop 1 a.(0) in Array.iteri (fun i v -> if i =0 then Printf.printf "%d" (v / g) else Printf.printf ":%d" (v / g)) a; print_newline() )