inputs: Solve in Python:
Anton is playing a very interesting computer game, but now he is stuck at one of the levels. To pass to the next level he has to prepare n potions.

Anton has a special kettle, that can prepare one potions in x seconds. Also, he knows spells of two types that can faster the process of preparing potions.  Spells of this type speed up the preparation time of one potion. There are m spells of this type, the i-th of them costs b_{i} manapoints and changes the preparation time of each potion to a_{i} instead of x.  Spells of this type immediately prepare some number of potions. There are k such spells, the i-th of them costs d_{i} manapoints and instantly create c_{i} potions. 

Anton can use no more than one spell of the first type and no more than one spell of the second type, and the total number of manapoints spent should not exceed s. Consider that all spells are used instantly and right before Anton starts to prepare potions.

Anton wants to get to the next level as fast as possible, so he is interested in the minimum number of time he needs to spent in order to prepare at least n potions.


-----Input-----

The first line of the input contains three integers n, m, k (1 ≤ n ≤ 2·10^9, 1 ≤ m, k ≤ 2·10^5) — the number of potions, Anton has to make, the number of spells of the first type and the number of spells of the second type.

The second line of the input contains two integers x and s (2 ≤ x ≤ 2·10^9, 1 ≤ s ≤ 2·10^9) — the initial number of seconds required to prepare one potion and the number of manapoints Anton can use.

The third line contains m integers a_{i} (1 ≤ a_{i} < x) — the number of seconds it will take to prepare one potion if the i-th spell of the first type is used.

The fourth line contains m integers b_{i} (1 ≤ b_{i} ≤ 2·10^9) — the number of manapoints to use the i-th spell of the first type.

There are k integers c_{i} (1 ≤ c_{i} ≤ n) in the fifth line — the number of potions that will be immediately created if the i-th spell of the second type is used. It's guaranteed that c_{i} are not...
targets: class First:
    def __init__(self, seconds, cost):
        self.seconds = seconds
        self.cost = cost
class Second:
    def __init__(self, numCreated, cost):
        self.numCreated = numCreated
        self.cost = cost

def solve():
    potionCount, firstCount, secondCount = map(int, input().split())
    secondsOne, manaPoints = map(int, input().split())
    first = list()
    a, b = list(map(int, input().split())), list(map(int, input().split()))
    for i in range(firstCount):
        first.append(First(a[i], b[i]))
    first.append(First(secondsOne, 0))
    second = [Second(0, 0)]
    a, b = list(map(int, input().split())), list(map(int, input().split()))
    for i in range(secondCount):
        second.append(Second(a[i], b[i]))
    res = int(1e20)
    for f in first:
        low = 0
        high = len(second) - 1
        while low < high:
            mid = (low + high + 1) // 2
            if f.cost + second[mid].cost > manaPoints:
                high = mid - 1
            else:
                low = mid
        if f.cost + second[low].cost <= manaPoints:
            moar = max(0, potionCount - second[low].numCreated)
            time = moar * f.seconds
            res = min(res, time)
    print(res)
solve()