let stream_fold f init st = let result = ref init in Stream.iter (fun x -> result := f x !result) st; !result let solve s = let len_s = String.length s in let cnt_maru = Stream.from (fun i -> if i >= len_s then None else Some(s.[i])) |> stream_fold (fun c cnt -> match c with | 'o' -> cnt + 1 | _ -> cnt) 0 in let rec solve' idx rest_maru = if idx < len_s then ( let rest_len = float_of_int @@ len_s - idx in Printf.printf "%.7f\n" @@ (float_of_int rest_maru) /. rest_len *. 100.; let rest_maru' = match s.[idx] with | 'o' -> rest_maru - 1 | _ -> rest_maru in solve' (idx + 1) rest_maru' ) in solve' 0 cnt_maru let () = let s = read_line () in solve s