Scanf.scanf "%d %d" (fun n m -> Printf.printf "%d\n" @@ if n mod 2 = 1 then ( if n <= m then 1 else (-1) ) else ( if n / 2 <= m then 2 else (-1) ) )