object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val t = Array.fill(n)(sc.nextInt())
  val v = Array.fill(n)(sc.nextInt())
  var endLimit = List(0)
  for (i <- n-2 to 0 by -1) {
    endLimit ::= v(i).min(v(i+1)).min(endLimit.head + t(i+1))
  }

  var now = 0
  var ans = 0.0
  for (i <- 0 until n) {
    if (now + t(i) <= endLimit(i)) {
      ans += (2 * now + t(i)) * t(i) / 2.0
      now += t(i)
    } else {
      val max = (endLimit(i) + now + t(i)) / 2.0
      ans += (now + max) * (max - now) / 2.0
      ans += (max + endLimit(i)) * (max - endLimit(i)) / 2.0
      if (max > v(i)) {
        val d = max - v(i)
        ans -= d * d
      }
      now = endLimit(i)
    }
  }
  println(ans)
}
