#include <cstdio>
int n;
long long a[1000010];
long long b[1000010];
int main()
{
long long ans=0;
int i;
while(~scanf("%d",&n))
{
ans=0;
for(i=1;i<=n;++i)
scanf("%I64d",&a[i]);
for(i=1;i<=n;++i)
scanf("%I64d",&b[i]);
for(i=1;i<=n;++i)
{
if(a[i]*2>=b[i]&&b[i]!=1)
{
long long p;
if(b[i]%2==0)
{
p=b[i]/2;
ans+=p*p;
}
else
{
p=b[i]/2;
ans+=p*(p+1);
}
}
else
--ans;
}
printf("%I64d\n",ans);
}
return 0;
}
Codeforces Round #229 (Div. 2) B. Inna, Dima and Song
最新推荐文章于 2022-07-13 02:01:45 发布