import java.io.{BufferedReader, IOException, InputStream, InputStreamReader}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.min

object Main {
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val N = sc.nextInt()
    val t = Array.ofDim[Int](N + 1) // t...tiまで累積
    (1 to N) foreach (i => t(i) = t(i - 1) + sc.nextInt())
    val v = Array.ofDim[Int](N + 2)
    (1 to N) foreach (i => v(i) = sc.nextInt())

    var ans = 0.0
    var v0 = 0.0
    var _t = 0.0
    for {
      i <- 1 to N
      _ <- 1 to (t(i) - t(i - 1)) * 2 // 0.5秒単位
    } {
      _t += 0.5
      val break = ((i to N) map (j => v(j + 1) + (t(j) - _t))).min // i+1以降の速度制限からブレーキをかけ始める場所がきまる
      val v1 = min(min(v(i), v0 + 0.5), break)
      ans += (v1 + v0) * 0.5 / 2
      v0 = v1
    }

    println(f"$ans%.4f")
  }

  def main(args: Array[String]): Unit = {
    solve()
  }

  class InputReader(val stream: InputStream) {
    val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextChar(): Char = next.charAt(0)
  }

}
