Imports System
 
Public Class Test
	Public Shared Sub Main()
		        Dim n As Integer
        Dim TT As String
        Dim VV As String
        n = Console.ReadLine()
        TT = Console.ReadLine()
        VV = Console.ReadLine()
        Dim TTT As String() = TT.Split(" "c)
        Dim VVV As String() = VV.Split(" "c)
        Dim v(n) As Integer
        Dim t(n - 1) As Integer
        Dim i As Integer = 0
        For Each vk As String In VVV
            v(i) = vk
            i += 1
        Next vk
        i = 0
        For Each tk As String In TTT
            t(i) = tk
            i += 1
        Next tk
        v(n) = 0
        Dim vnow As Double = 0
        Dim dnow As Double = 0
        Dim time As Double = 0.5
        Dim SumT As Double = 0
        For i = 0 To n - 1
            SumT += t(i)
        Next
        For i = 0 To n - 1
            For j As Double = 0.5 To t(i) Step 0.5
                If ((v(i) > vnow) And (vnow - (t(i) - j - 0.5) <= v(i + 1))) And (vnow - (SumT - time - 0.5) <= 0) Then
                    vnow += 0.5
                    dnow += 0.5 * vnow - 0.125
                ElseIf ((v(i) = vnow) And (vnow - (t(i) - j) <= v(i + 1))) Then
                    dnow += vnow * 0.5
                Else
                    vnow -= 0.5
                    dnow += 0.5 * vnow + 0.125
                End If
                time += 0.5
            Next j
        Next i
        Console.WriteLine(dnow)
        	End Sub
End Class