import Debug.Trace

main = do
  n <- readLn :: IO Int
  ts <- getLine >>= return . (map read) . words :: IO [Double]
  vs <- getLine >>= return . (map read) . words :: IO [Double]

  print $ sum $ solve ts vs

  where
    solve :: [Double] -> [Double] -> [Double]
    solve ts vs = solve' 0 ts vs (tail $ maxVelo ts vs)

    solve' :: Double -> [Double] -> [Double] -> [Double] -> [Double]
    solve' _ [] _ _ = []
    solve' s (t:ts) (v:vs) (m:ms) =
      if v <= m then
        if v-s <= t then
          (t*v - (v-s)^2/2) : (solve' v ts vs ms)
        else
          (t*s + t*t/2) : (solve' (s+t) ts vs ms)
      else
        if s+t <= m then
          (t*s + t*t/2) : (solve' (s+t) ts vs ms)
        else
          let
            x1 = v - s;
            x2 = t + m - v;
          in
            if x1 <= x2 then
              (x1*(s+v)/2 + (x2-x1)*v + (t-x2)*(m+v)/2) : (solve' m ts vs ms)
            else
              let x' = t-s+m
              in
                ((x'/2)*(2*s+(x'/2))/2 + (t-(x'/2))*(m+s+(x'/2))/2) : (solve' m ts vs ms)
              
        
    maxVelo :: [Double] -> [Double] -> [Double]
    maxVelo [] _ = [0]
    maxVelo (t:ts) (v:vs) = (min v (next+t)) : r
      where
        r = maxVelo ts vs
        next = head r