Inna is a great piano player and Dima is a modest guitar player. Dima has recently written a song and they want to play it together. Of course, Sereja wants to listen to the song very much. 

A song is a sequence of notes. Dima and Inna want to play each note at the same time. At that, they can play the i-th note at volume v (1 ≤ v ≤ a_{i}; v is an integer) both on the piano and the guitar. They should retain harmony, so the total volume with which the i-th note was played on the guitar and the piano must equal b_{i}. If Dima and Inna cannot play a note by the described rules, they skip it and Sereja's joy drops by 1. But if Inna and Dima play the i-th note at volumes x_{i} and y_{i} (x_{i} + y_{i} = b_{i}) correspondingly, Sereja's joy rises by x_{i}·y_{i}. 

Sereja has just returned home from the university and his current joy is 0. Help Dima and Inna play the song so as to maximize Sereja's total joy after listening to the whole song!


-----Input-----

The first line of the input contains integer n (1 ≤ n ≤ 10^5) — the number of notes in the song. The second line contains n integers a_{i} (1 ≤ a_{i} ≤ 10^6). The third line contains n integers b_{i} (1 ≤ b_{i} ≤ 10^6).


-----Output-----

In a single line print an integer — the maximum possible joy Sereja feels after he listens to a song.


-----Examples-----
Input
3
1 1 2
2 2 3

Output
4

Input
1
2
5

Output
-1



-----Note-----

In the first sample, Dima and Inna play the first two notes at volume 1 (1 + 1 = 2, the condition holds), they should play the last note at volumes 1 and 2. Sereja's total joy equals: 1·1 + 1·1 + 1·2 = 4.

In the second sample, there is no such pair (x, y), that 1 ≤ x, y ≤ 2, x + y = 5, so Dima and Inna skip a note. Sereja's total joy equals -1.

Difficulty: interview

Starter code:

Solutions:
n, a, b = input(), map(int, input().split()), map(int, input().split())
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
for i in range(n):
  if 2 * a[i] < b[i]:
    s -= 1
  else:
    x = b[i] // 2
    y = b[i] - x
    if x * y != 0:
      s += x * y
    else:
      s -= 1
print(s)

# 10
# 1 2 3 4 5 6 7 8 9 10
# 1 2 3 4 5 6 7 8 9 10


R = lambda:list(map(int, input().split()))
n, = R()
a = R()
b = R()
s = 0
for i in range(n):
  if 2 * a[i] < b[i] or b[i] == 1:
    s -= 1
  else:
    x = b[i] // 2
    y = b[i] - x
    s += x * y
print(s)

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    if 2 * a[i] >= b[i] and b[i] > 1:
        x = b[i] // 2
        ans += (x * (b[i] - x))
    else:
        ans -= 1
print(ans)

n = int(input())
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
sum = 0
for i in range(n):
    if b[i] == 1 or a[i] + a[i] < b[i]:
        sum = sum - 1
    else:
        sum = sum + (b[i] // 2) * (b[i] - b[i] // 2)
print(sum)


from math import *

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

res = 0
for i in range(n):
    if 2 * a[i] < b[i] or b[i] == 1:
        res -= 1
    else: res += b[i] // 2 * (b[i] - (b[i] // 2))
print(res)


n, a, b = input(), map(int, input().split()), map(int, input().split())
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))

n,j=int(input()),0
a=list(map(int,input().split()))
b=list(map(int,input().split()))
for i in range(n):
  if b[i]>a[i]*2 or b[i]==1:j-=1
  else: j+=(b[i]//2)*(b[i]-b[i]//2)
print(j)
#WA Test:3,4,5,Hoping for 6


n = int(input())
a,b = list(map(int,input().split())), list(map(int,input().split()))
r = 0
for i in range(n):
	if 2*a[i] >= b[i] and b[i]>1:
		x = b[i]//2
		y = b[i]-x
		r += x*y
	else:
		r -= 1
print(r)

n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
happiness = 0
for i in range(n):
    if (b[i] + 1) // 2 <= a[i] and b[i] > 1:
        happiness += (b[i] // 2) * ((b[i] + 1) // 2)
    else:
        happiness -= 1
print(happiness)

n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n,j=int(input()),0
a=list(map(int,input().split()))
b=list(map(int,input().split()))
for i in range(n):
  if b[i]>a[i]*2 or b[i]==1:j-=1
  else: j+=(b[i]//2)*(b[i]-b[i]//2)
print(j)

n, a, b = input(), list(map(int, input().split())), list(map(int, input().split()))

print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))



# Made By Mostafa_Khaled


import math
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=int(0)
for i in range(n):
    if b[i]== 1:
        c-=1
    elif a[i]*2 < b[i]:
        c-=1
    else:
        if b[i]%2 == 0:
            c+=int((b[i]/2)**2)
        else:
            c+=int((int(math.ceil(b[i]/2)))*(int(math.floor(b[i]/2))))
print(c)

import math
n = int(input())
aList = list(map(int,input().split()))
bList = list(map(int,input().split()))
joy = 0
for i in range(n):
    if bList[i] == 1:
        joy = joy - 1
    else:
        if bList[i] % 2 == 0:
            b1 = bList[i] / 2
            b2 = bList[i] / 2
        else:
            b1 = math.floor(bList[i] / 2)
            b2 = math.ceil(bList[i] / 2)
        if b2 <= aList[i]:
            joy = joy + b1 * b2
        else:
            joy = joy - 1
print(int(joy))

def great_sum_finder(num, rang):
    if abs(num - rang) > rang or num == 1:
        return -1
    if rang == 1:
        return 1
    if num < rang:
        return great_sum_finder(num, num - 1)
    return (num // 2) * (num - num // 2)


n = int(input())
a = input().split()
b = input().split()
a = list(map(int, a))
b = list(map(int, b))
joy = 0
for i in range(n):
    joy += great_sum_finder(b[i], a[i])
print(joy)


import math
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=int(0)
for i in range(n):
    if b[i]== 1:
        c-=1
    elif a[i]*2 < b[i]:
        c-=1
    else:
        if b[i]%2 == 0:
            c+=int((b[i]/2)**2)
        else:
            c+=int((int(math.ceil(b[i]/2)))*(int(math.floor(b[i]/2))))
print(c)

import math

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res, v1, v2 = 0, 0, 0
for i in range(n):
	if b[i]>1 and b[i]<=2*a[i]:
		v1 = math.ceil(b[i]/2)
		v2 = b[i]-v1
		res += v1*v2
	else:
		res -= 1
print(res)