Scanf.scanf "%d %d" (fun d1 d2 -> Printf.printf "%d\n" @@ if 2 * d1 < d2 || d1 > d2 then 0 else if 2 * d1 = d2 || d1 = d2 then 4 else 8 )