import Control.Applicative import Data.List repeated_combination ns n = comb n [(ns,[])] where comb 0 xs = [a|(_,a)<-xs] comb c xs = comb (c-1) $ concatMap f xs f (xs,ys) = [(as,ys++[a])|as@(a:_)<-tails xs] main = do n <- (80-).read <$> getLine [a,b,c] <- map ((/100).read) . words <$> getLine let pa 0 = [1,1] pa 1 = [1,a,1] pa n = [1,b]++(replicate (n-2) c)++[b,1] update s n = foldl (sub s $ pa n) 0 $ repeated_combination [1..n] 2 sub s p t [i,j] = t+(foldl (\u k->u*(1-p!!k)) (s!!(j-i+1)*p!!(i-1)*p!!(j+1)) [i..j]) in print $ ((foldl (\s _->map (update s) [0..14]) [0..14] [1..n])!!14)*2