5923: 瓦夏和公共交通

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:5 通过:4

题目描述

瓦夏经常使用公共交通工具。城市的交通工具有两种类型:手推车和公共汽车。该市有n辆公共汽车和m辆无轨电车,公共汽车按1到n的整数编号,无轨电车按1到m的整数编号。
公共交通不是免费的。有4种类型的门票:
乘坐公共汽车或手推车的一张票。它花费 c1 burles;
无限次乘坐公共汽车或电车的车票。它花费 c2 burles;
一张无限次乘坐所有公共汽车或所有手推车的车票。它花费 c3 伯勒斯;
一张无限次乘坐所有公共汽车和手推车的车票。它花费 c4 burles。
瓦夏肯定知道他将要乘坐的次数以及他将使用的交通工具。他请你帮忙找到他必须在门票上花费的最低金额。

Vasya often uses public transport. The transport in the city is of two types: trolleys and buses. The city has n buses and m trolleys, the buses are numbered by integers from 1 to n, the trolleys are numbered by integers from 1 to m.
Public transport is not free. There are 4 types of tickets:
  1. A ticket for one ride on some bus or trolley. It costs c1 burles;
  2. A ticket for an unlimited number of rides on some bus or on some trolley. It costs c2 burles;
  3. A ticket for an unlimited number of rides on all buses or all trolleys. It costs c3 burles;
  4. A ticket for an unlimited number of rides on all buses and trolleys. It costs c4 burles.
Vasya knows for sure the number of rides he is going to make and the transport he is going to use. He asked you for help to find the minimum sum of burles he will have to spend on the tickets.
Input
The first line contains four integers c1,c2,c3,c4 (1≤c1,c2,c3,c4≤1000) − the costs of the tickets.
The second line contains two integers n and m (1≤n,m≤1000) − the number of buses and trolleys Vasya is going to use.
The third line contains n integers ai (0≤ai≤1000) − the number of times Vasya is going to use the bus number i.
The fourth line contains m integers bi (0≤bi≤1000) − the number of times Vasya is going to use the trolley number i.
Output
Print a single number − the minimum sum of burles Vasya will have to spend on the tickets.
Examples
Input
1 3 7 19
2 3
2 5
4 4 4
Output
12
Input
4 3 2 1
1 3
798
1 2 3
Output
1
Input
100 100 8 100
3 5
7 94 12
100 1 47 0 42
Output
16
Note
In the first sample the profitable strategy is to buy two tickets of the first type (for the first bus), one ticket of the second type (for the second bus) and one ticket of the third type (for all trolleys). It totals to (2·1)+3+7=12 burles.
In the second sample the profitable strategy is to buy one ticket of the fourth type.
In the third sample the profitable strategy is to buy two tickets of the third type: for all buses and for all trolleys.

输入格式

第一行包含四个整数 c1,c2,c3,c4 (1≤c1,c2,c3,c4≤1000) - 门票成本。
第二行包含两个整数 n 和 m (1≤n,m≤1000) - Vasya 将使用的公共汽车和手推车的数量。
第三行包含 n 个整数 ai (0≤ai≤1000) − Vasya 将使用总线编号 i 的次数。
第四行包含 m 个整数 bi (0≤bi≤1000) − Vasya 将使用手推车编号 i 的次数。

输出格式

打印一个数字 - 瓦夏必须在门票上花费的最小毛刺总和。
例子
输入
1 3 7 19
6 ·
2 5
4 4 4
输出
12
输入
4 3 2 1
1 3
798
1 2 3
输出
1
输入
100 100 8 100
3 5
7 94 12
100 1 47 0 42
输出
16
注意
在第一个样本中,有利可图的策略是购买两张第一类车票(第一班车),一张第二种车票(第二辆公共汽车)和一张第三种车票(适用于所有手推车)。它总共为 (2·1)+3+7=12 个伯勒斯。
在第二个样本中,有利可图的策略是购买第四种类型的一张票。
在第三个样本中,有利可图的策略是购买第三种类型的两张票:所有公共汽车和所有手推车。

输入样例 复制

1 3 7 19
2 3
2 5
4 4 4

输出样例 复制

12