let (|Safe|Out|) = function | 'o' -> Safe | _ -> Out let counter = Array.fold (fun acc c -> match c with | Safe -> (fst acc + 1, snd acc ) | _ -> (fst acc , snd acc + 1)) (0,0) let calP (safeCnt,outCnt) = let sCnt = safeCnt |> float let oCnt = outCnt |> float let cntSum = sCnt + oCnt if cntSum > 0.0 then sCnt / cntSum * 100.0 else 0.0 let S = stdin.ReadLine().ToCharArray() let cnts = S |> counter S |> Array.scan (fun acc x -> match x with | Safe -> (fst acc - 1, snd acc ) | Out -> (fst acc , snd acc - 1)) cnts |> Array.take (S.Length) |> Array.map (calP) |> Array.iter(printfn "%f")