#586. 「Nowcoder多校 2019 Day4」sequence
「Nowcoder多校 2019 Day4」sequence
当前没有测试数据。
题目描述
Your are given two sequences and .You need to answer $ max_{1 \le l \le r \le n} \{min(a_{l \dots r}) \times sum(b_{l \dots r})\} $。
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 . 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
样例输出 1
3
数据范围与提示
For all test datas, ,.