sequence
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Your are given two sequences and .You need to answer

Where min(a) means the minimal value of every element of sequence a, sum(a) means the sum of every element of sequence a .

输入描述:

The first line contains an integer n .

The second line contains n integers meaning .

The third line contains n integers meaning .

输出描述:

An integer meaning the answer.
示例1

输入

复制
3
1 -1 1
1 2 3

输出

复制
3

备注:

For all test datas, .