CF355B Vasya and Public Transport

题目描述

``` Vasya 所在城市的交通工具有两种类型:手推车和公共汽车。 其中公共汽车有 n 辆,手推车有 m 辆。 公共汽车的编号为 a1,a2,..an,手推车的编号为 b1,b2,..bn 交通工具的门票有 4 种类型: 1: 乘坐某辆公共汽车或手推车的车票, 它需要 c1 元 2: 在某辆公共汽车或某些手推车上无限次乘坐的车票, 它需要 c2 元 3: 所有公共汽车或所有手推车上无限次乘坐的车票, 它需要 c3 元 4: 所有公共汽车和手推车上无限次乘坐的车票, 它需要c4 元。

输入格式

第一行包含 4 个整数: c1,c2,c3,c4 第二行包含 2 个整数: n,m 第三行包含 n 个整数: a1..an 第四行包含 m 个整数: b1..bm

输出格式

一个整数,即 Vasya 所要支付的最少钱数 数据规模: 1

说明/提示

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.