Rohit live in Janakpuri and uses public transport to go to college that is on Dwarka. The transport from Janakpuri to Dwarka is of two types: cabs and rickshaws. The city has n rickshaws and m cabs, the rickshaws are numbered by integers from 1 to n, the cabs are numbered by integers from 1 to m.

Public transport is not free. There are 4 types of tickets:

A ticket for one ride on some rickshaw or cab. It costs c1 rupees;
A ticket for an unlimited number of rides on some rickshaw or on some cab. It costs c2 rupees;
A ticket for an unlimited number of rides on all rickshaws or all cabs. It costs c3 rupees;
A ticket for an unlimited number of rides on all rickshaws and cabs. It costs c4 rupees.

Rohit 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 rupees he will have to spend on the tickets.

Input Format :-

Each Test case has 4 lines which are as follows:

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 rickshaws and cabs Rohit is going to use. The third line contains n integers ai (0 ≤ ai ≤ 1000) — the number of times Rohit is going to use the rickshaw number i. The fourth line contains m integers bi (0 ≤ bi ≤ 1000) — the number of times Rohit is going to use the cab number i.

Output Format :-

Print a single number — the minimum sum of rupees Rohit will have to spend on the tickets.

CommentsNo comment yet.