日本情報オリンピック 第5回 予選 第5問目

色々と忙しくなってきたから手抜きする。

retry :: Int -> Float -> Float
retry 0 _ = 0
retry 1 x = sum $ map ((*) ((/) 1 x) . (/) 1) [1..x-1]

play :: Int -> Float -> Float
play x y = ((/) 1 y) + (retry x y)

明日からは、Write Yourself a Scheme in 48 Hours を読もうと思います。
http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html