let D = "1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991" let f n = seq { for i in D.Length-1..-1..0 -> n * int D.[i..i] } let g m n = Seq.zip (seq { yield 0; yield! f m; yield 0; }) (seq { yield! f n; yield 0; yield 0; }) let rec iter i c sq = let e = c + Seq.head sq seq { yield e%10 if i>0 then yield! iter (i-1) (e/10) (Seq.skip 1 sq) else if c<>0 && e/10<>0 then yield e/10 } let rec iter2 i c sq = let (e1,e2) = Seq.head sq seq { yield (e1+e2+c)%10 if i>0 then yield! iter2 (i-1) ((e1+e2+c)/10) (Seq.skip 1 sq) else if c<>0 && (e1+e2+c)/10<>0 then yield (e1+e2+c)/10 } let fmt = Seq.map string >> Seq.fold (fun a e -> e + a) "" >> fun (s:string) -> if s.Length<>D.Length then s.[0..s.Length-D.Length-1] + "." + s.[s.Length-D.Length..s.Length-1] else "0." + s let s = stdin.ReadLine() match s.Length with | 1 -> iter (D.Length-1) 0 (f (int s)) |> fmt | 2 -> iter2 D.Length 0 (g (int s.[0..0]) (int s.[1..1])) |> fmt | _ -> D.[0..1] + "." + D.[2..D.Length-1] |> printfn "%s"