let sosu_dice = [13; 11; 7; 5; 3; 2;] let comp_dice = [12; 10; 9; 8; 6; 4;] let rec can_divide n lst = match lst with | [] -> None | x::xs -> if n mod x = 0 then Some (n / x) else can_divide n xs let () = let k = read_int () in let ans = match can_divide k sosu_dice with | None -> 0. | Some x -> match can_divide x comp_dice with | None -> 0. | Some 1 -> 1. /. 36. | _ -> 0. in Printf.printf "%0.13f\n" ans