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 bi manapoints and changes the preparation time of each potion to ai instead of x.  Spells of this type immediately prepare some number of potions. There are k such spells, the i-th of them costs di manapoints and instantly create ci 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.

The first line of the input contains three integers n, m, k (1 ≤ n ≤ 2·109, 1 ≤ m, k ≤ 2·105) — 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·109, 1 ≤ s ≤ 2·109) — the initial number of seconds required to prepare one potion and the number of manapoints Anton can use. The third line contains m integers ai (1 ≤ ai < 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 bi (1 ≤ bi ≤ 2·109) — the number of manapoints to use the i-th spell of the first type. There are k integers ci (1 ≤ ci ≤ 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 ci are not decreasing, i.e. ci ≤ cj if i < j. The sixth line contains k integers di (1 ≤ di ≤ 2·109) — the number of manapoints required to use the i-th spell of the second type. It's guaranteed that di are not decreasing, i.e. di ≤ dj if i < j.

Print one integer — the minimum time one has to spent in order to prepare n potions.

NoteIn the first sample, the optimum answer is to use the second spell of the first type that costs 10 manapoints. Thus, the preparation time of each potion changes to 4 seconds. Also, Anton should use the second spell of the second type to instantly prepare 15 potions spending 80 manapoints. The total number of manapoints used is 10 + 80 = 90, and the preparation time is 4·5 = 20 seconds (15 potions were prepared instantly, and the remaining 5 will take 4 seconds each).In the second sample, Anton can't use any of the spells, so he just prepares 20 potions, spending 10 seconds on each of them and the answer is 20·10 = 200.

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		} else {
			continue
		}
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
			ss -= kk[vvv-1][1]
		}
		if ss >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	//"math"
)

func solve() {
    n, m, k, x, s := readInt(), readInt(), readInt(), readInt(), readInt()
    a, b := readIntArray(m), readIntArray(m)
    c, d := readIntArray(k), readIntArray(k)

    cc, dd := []int{}, []int{}
    for i := 0; i < k; i++ {
        if i == k-1 || d[i] < d[i+1] {
            cc = append(cc, c[i])
            dd = append(dd, d[i])
        }
    }
    c, d, k = cc, dd, len(cc)

    findC := func(mana int) int {
        l, r := 0, k-1
        if d[l] > mana {
            return 0
        }

        for l < r {
            mid := (l+r+1) / 2
            if d[mid] > mana {
                r = mid - 1
            } else {
                l = mid
            }
        }

        return c[l]
    }

    ans := int64(n) * int64(x)
    for i := 0; i <= m; i++ {
        mana, speed := s, x
        if i < m && mana >= b[i] {
            mana -= b[i]
            speed = a[i]
        }
        cnt := int64(max(n - findC(mana), 0))
        curAns := cnt * int64(speed)
        if curAns < ans {
            ans = curAns
        }
    }
    fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

var bufin *bufio.Reader
var bufout *bufio.Writer

type Spell struct {
	time int
	mana int
}

type SpellSlice []Spell

func (s SpellSlice) Len() int          { return len(s) }
func (s SpellSlice) Swap(i int, j int) { s[i], s[j] = s[j], s[i] }
func (s SpellSlice) Less(i int, j int) bool {
	return s[i].mana < s[j].mana
}

func min(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var n, m, k int
	var x, s int

	fmt.Fscanf(bufin, "%d %d %d\n", &n, &m, &k)
	fmt.Fscanf(bufin, "%d %d\n", &x, &s)

	spells := make(SpellSlice, m+1)
	spells[0] = Spell{time: x, mana: 0}

	for i := 1; i <= m; i++ {
		fmt.Fscanf(bufin, "%d\n", &spells[i].time)
	}
	for i := 1; i <= m; i++ {
		fmt.Fscanf(bufin, "%d\n", &spells[i].mana)
	}

	c := make([]int, k)
	d := make([]int, k)
	for i := 0; i < k; i++ {
		fmt.Fscanf(bufin, "%d\n", &c[i])
	}
	for i := 0; i < k; i++ {
		fmt.Fscanf(bufin, "%d\n", &d[i])
	}

	sort.Sort(spells)
	res := int64(x) * int64(n)

	j := k - 1
	for i := 0; i <= m; i++ {
		if spells[i].mana <= s {
			remainMana := s - spells[i].mana
			remainPotion := n
			remainTime := spells[i].time
			for (j >= 0) && (d[j] > remainMana) {
				j--
			}
			if j >= 0 {
				remainPotion -= c[j]
			}
			total := int64(remainPotion) * int64(remainTime)
			if total < res {
				res = total
			}
		}
	}

	fmt.Fprintf(bufout, "%d\n", res)
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+2; idx++ {
		var mpleft int64
		var singletime int64
		if idx == m+1 || s < bi[idx] {
			mpleft = s
			singletime = x
		} else {
			mpleft = s - bi[idx]
			singletime = ai[idx]
		}
		in := bsi64(di, mpleft)
		lefttask := n - ci[in]
		wholetime := int64(singletime) * int64(lefttask)
		if wholetime < last {
			last = wholetime
		}
	}
	oi(last)
	// if n == 1997320486 {
	// 	ostring(" ")
	// 	oi(int64(lastidx))
	// 	ostring(" ")
	// 	oi(lastin)
	// }
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, k int64) int64 {
	i := int64(0)
	j := int64(len(s) - 1)
	for i < j {
		m := (i + j + 1) / 2
		if s[m] <= k {
			i = m
		} else {
			j = m - 1
		}
	}
	return i
}

// Codeforces 734 C AntonMakingPotions,
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
	"strconv"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i:=0; i<len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for j:=0; j<n; j++ {
		aa,err := strconv.Atoi(ss[j])
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[j] = aa
	}
	return a
}

var n,m,k int
var x,s int
var a []int
var b []int
var c []int
var d []int

var minTime int64

func readData() {
	in = bufio.NewReader(os.Stdin)
	// reading field
	n,m,k,_,_ = readFive()
	x,s,_,_,_ = readFive()
	a = readLineNumbs(m)
	b = readLineNumbs(m)
	c = readLineNumbs(k)
	d = readLineNumbs(k)
}

func binFindMaxLessd(lman int) int {
	if lman<d[0] {
		return -1
	}
	i0 := 0
	i1 := k
	for i1 > i0 {
		ii := (i0 + i1)/2
		//fmt.Printf("ii,i0,i1 = %d %d %d d[ii],lman = %d %d\n",ii,i0,i1,d[ii],lman)
		if ii==i0 {
			break
		} else if d[ii] <= lman {
			i0 = ii
		} else {
			i1 = ii
		}
	}
	//fmt.Printf("binFindMaxLessd(), lman i0 = %d %d\n", lman, i0)
	return i0
}

func solve() {
	minTime = int64(n)*int64(x)
	a = append(a, int(x))
	b = append(b, 0)
	for i:=0; i<m+1; i++ {
		if b[i] <= s {
			o := s-b[i]
			nskip := 0
			didx := binFindMaxLessd(o)
			if didx>=0 {
				nskip = c[didx]
			}
			ctime := int64(a[i]) * int64(n-nskip)
			if ctime < minTime {
				minTime = ctime
			}
		}
	}
}

func printRes() {
	fmt.Println(minTime)
}

func main() {
	readData()
	solve()
	printRes()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const MAX_MK = 200010

var N int64
var M, K int
var X, S int64
var A [MAX_MK]int64
var B [MAX_MK]int64
var C [MAX_MK]int64
var D [MAX_MK]int64

func lowerBound(mana int64) int64 {
	var left, right int
	left = -10
	right = K + 10
	var result int64
	result = 0
	for right-left > 1 {
		med := (right + left) / 2
		//fmt.Println("med", med)
		if med < 0 {
			left = med
			continue
		}
		if med > K-1 {
			right = med
			continue
		}
		reqMana := D[med]
		if reqMana > mana {
			right = med
		} else {
			left = med
			result = C[med]
		}
	}
	return result
}

func solve() {
	var result int64
	result = 1 << 62
	for i := 0; i < int(M+1); i++ {
		var pre, mana int64
		if i < int(M) && B[i] <= S {
			pre = A[i]
			mana = S - B[i]
		} else {
			pre = X
			mana = S
		}
		var needPotions int64
		needPotions = N
		needPotions -= lowerBound(mana)
		if needPotions <= 0 {
			result = 0
			break
		}

		if needPotions*pre < result {
			result = needPotions * pre
		}
		//fmt.Println(i, needPotions, pre)
		//fmt.Println(i, needPotions*pre)
	}
	fmt.Println(result)
}

func main() {
	fsc := NewFastScanner()
	N, M, K = fsc.NextInt64(), fsc.NextInt(), fsc.NextInt()
	X, S = fsc.NextInt64(), fsc.NextInt64()
	for i := 0; i < M; i++ {
		A[i] = fsc.NextInt64()
	}
	for i := 0; i < M; i++ {
		B[i] = fsc.NextInt64()
	}

	for i := 0; i < K; i++ {
		C[i] = fsc.NextInt64()
	}
	for i := 0; i < K; i++ {
		D[i] = fsc.NextInt64()
	}
	solve()
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		} else {
			continue
		}
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
		}
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n uint64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n uint64) {
	var m, k, x, s uint64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]uint64, m)
	kk := make([][2]uint64, k)
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := uint64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss = s - mm[i][1]
		}
		nn := n - gg(ss, k, kk)
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

func gg(s, k uint64, kk [][2]uint64) uint64 {
	if s < kk[0][1] {
		return 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0]
	}
	o := uint64(0)
	oo := k
	for oo != o {
		ooo := (oo + o + 1) / 2
		if s >= kk[ooo][1] {
			o = ooo
		} else {
			oo = ooo - 1
		}
	}
	return kk[o][0]
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n uint64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n uint64) {
	var m, k, x, s uint64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]uint64, m)
	kk := make([][2]uint64, k)
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := uint64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss = s - mm[i][1]
		}
		nn := n - gg(ss, k, kk)
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

func gg(s, k uint64, kk [][2]uint64) uint64 {
	if s < kk[0][1] {
		return 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0]
	}
	o := uint64(0)
	oo := k
	for oo > o && s != kk[o][1] {
		ooo := (oo + o + 1) / 2
		if s > kk[ooo][1] {
			o = ooo
		} else {
			oo = ooo - 1
		}
	}
	return kk[o][0]
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n uint64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n uint64) {
	var m, k, x, s uint64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]uint64, m)
	kk := make([][2]uint64, k)
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := uint64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss = s - mm[i][1]
		}
		nn := n - gg(ss, k, kk)
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

func gg(s, k uint64, kk [][2]uint64) uint64 {
	if s < kk[0][1] {
		return 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0]
	}
	o := uint64(0)
	oo := k
	for {
		ooo := (oo + o) / 2
		if oo == o || s == kk[o][1] {
			return kk[o][0]
		} else if s < kk[o][1] {
			o = ooo
		} else {
			oo = ooo
		}
	}
	return 0
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		pp, ppp := gg(ss, k, kk)
		ss -= ppp
		nn := n - pp
		if ss >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		if min > xx*nn {
			min = xx * nn
		}

	}
	O(min, "\n")
}

func gg(s, k int64, kk [][2]int64) (int64, int64) {
	if s < kk[0][1] {
		return 0, 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0], kk[k-1][1]
	}
	o := int64(0)
	oo := k
	for oo != o {
		ooo := (oo + o + 1) / 2
		if s > kk[ooo][1] {
			o = ooo
		} else {
			oo = ooo - 1
		}
	}
	return kk[o][0], kk[o][1]
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		nn := n
		vv := int(k)
		vvv := sort.Search(vv, func(v int) bool { return kk[v][1] > ss })
		if vvv != 0 {
			nn -= kk[vvv-1][0]
			ss -= kk[vvv-1][1]
		}
		if ss >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var m, k, x, s int64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]int64, m)
	kk := make([][2]int64, k)
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := int64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := int64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := int64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss -= mm[i][1]
		}
		nn := n
		qq := gg(ss, k, kk)
		if qq > 0 {
			nn -= qq
		}
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

func gg(s, k int64, kk [][2]int64) int64 {
	if s < kk[0][1] {
		return 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0]
	}
	o := int64(0)
	oo := k
	for oo > o && s != kk[o][1] {
		ooo := (oo + o + 1) / 2
		if s > kk[ooo][1] {
			o = ooo
		} else {
			oo = ooo - 1
		}
	}
	return kk[o][0]
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n uint64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n uint64) {
	var m, k, x, s uint64
	I(&m, " ")
	I(&k, "\n")
	I(&x, " ")
	I(&s, "\n")
	mm := make([][2]uint64, m)
	kk := make([][2]uint64, k)
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][0], o)
	}
	for i := uint64(0); i < m; i++ {
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&mm[i][1], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][0], o)
	}
	for i := uint64(0); i < k; i++ {
		o := " "
		if i == k-1 {
			o = "\n"
		}
		I(&kk[i][1], o)
	}
	min := n * x
	for i := uint64(0); i < m; i++ {
		xx := x
		ss := s
		if s >= mm[i][1] {
			xx = mm[i][0]
			ss = s - mm[i][1]
		}
		nn := n - gg(ss, k, kk)
		if min > xx*nn {
			min = xx * nn
		}
	}
	O(min, "\n")
}

func gg(s, k uint64, kk [][2]uint64) uint64 {
	if s < kk[0][1] {
		return 0
	} else if s >= kk[k-1][1] {
		return kk[k-1][0]
	}
	o := uint64(0)
	oo := k
	for oo != o && s != kk[o][1] {
		ooo := (oo + o + 1) / 2
		if s > kk[ooo][1] {
			o = ooo
		} else {
			oo = ooo - 1
		}
	}
	return kk[o][0]
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	//"math"
)

func solve() {
    n, m, k, x, s := readInt(), readInt(), readInt(), readInt(), readInt()
    a, b := readIntArray(m), readIntArray(m)
    c, d := readIntArray(k), readIntArray(k)

    findC := func(mana int) int {
        l, r := 0, k-1
        if d[l] > mana {
            return 0
        }

        for l < r {
            mid := (l+r+1) / 2
            if d[mid] > mana {
                r = mid - 1
            } else {
                l = mid
            }
        }

        return c[l]
    }

    ans := n * s
    for i := 0; i <= m; i++ {
        mana, speed := s, x
        if i < m {
            mana -= b[i]
            speed = a[i]
        }
        cnt := n - findC(mana)
        ans = min(ans, cnt * speed)
    }
    fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	//"math"
)

func solve() {
    n, m, k, x, s := readInt(), readInt(), readInt(), readInt(), readInt()
    a, b := readIntArray(m), readIntArray(m)
    c, d := readIntArray(k), readIntArray(k)
    cc, dd := []int{}, []int{}
    for i := 0; i < k; i++ {
        if i == k-1 || d[i] < d[i+1] {
            cc = append(cc, c[i])
            dd = append(dd, d[i])
        }
    }
    c, d, k = cc, dd, len(cc)

    findC := func(mana int) int {
        l, r := 0, k-1
        if d[l] > mana {
            return 0
        }

        for l < r {
            mid := (l+r+1) / 2
            if d[mid] > mana {
                r = mid - 1
            } else {
                l = mid
            }
        }

        return c[l]
    }

    ans := int64(n) * int64(s)
    for i := 0; i <= m; i++ {
        mana, speed := s, x
        if i < m && mana > b[i] {
            mana -= b[i]
            speed = a[i]
        }
        cnt := int64(max(n - findC(mana), 0))
        curAns := cnt * int64(speed)
        if curAns < ans {
            ans = curAns
        }
    }
    fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	//"math"
)

func solve() {
    n, m, k, x, s := readInt(), readInt(), readInt(), readInt(), readInt()
    a, b := readIntArray(m), readIntArray(m)
    c, d := readIntArray(k), readIntArray(k)

    findC := func(mana int) int {
        l, r := 0, k-1
        if d[l] > mana {
            return 0
        }

        for l < r {
            mid := (l+r+1) / 2
            if d[mid] > mana {
                r = mid - 1
            } else {
                l = mid
            }
        }

        return c[l]
    }

    ans := int64(n) * int64(s)
    for i := 0; i <= m; i++ {
        mana, speed := s, x
        if i < m && mana > b[i] {
            mana -= b[i]
            speed = a[i]
        }
        cnt := int64(max(n - findC(mana), 0))
        curAns := cnt * int64(speed)
        if curAns < ans {
            ans = curAns
        }
    }
    fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	//"math"
)

func solve() {
    n, m, k, x, s := readInt(), readInt(), readInt(), readInt(), readInt()
    a, b := readIntArray(m), readIntArray(m)
    c, d := readIntArray(k), readIntArray(k)

    findC := func(mana int) int {
        l, r := 0, k-1
        if d[l] > mana {
            return 0
        }

        for l < r {
            mid := (l+r+1) / 2
            if d[mid] > mana {
                r = mid - 1
            } else {
                l = mid
            }
        }

        return c[l]
    }

    ans := n * s
    for i := 0; i <= m; i++ {
        mana, speed := s, x
        if i < m && mana > b[i] {
            mana -= b[i]
            speed = a[i]
        }
        cnt := n - findC(mana)
        ans = min(ans, max(cnt, 0) * speed)
    }
    fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+1; idx++ {
		if bi[idx] <= s { // type 1 used
			mpleft := s - bi[idx]
			singletime := ai[idx]
			in := bsi64(di, 1, int64(k), mpleft)
			if in == int64(k+1) {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > int64(k) {
						break
					}
					if in+1 == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		} else { // type one not used
			mpleft := s
			singletime := x
			in := bsi64(di, 1, int64(k), mpleft)
			if in == int64(k+1) {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > int64(k) {
						break
					}
					if in+1 == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		}
	}
	oi(last)
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, i, j, k int64) int64 {
	for {
		if i == j {
			if k <= s[i] {
				return i
			}
			if k > s[i] {
				return i + 1
			}
		}
		centeri := (i + j) / 2
		centerv := s[centeri]
		if k == centerv {
			return centeri
		}
		if k > centerv {
			i = centeri + 1
			continue
		}
		if k < centerv {
			j = centeri - 1
			if j < i {
				j = i
			}
			continue
		}
	}
}

package main

import "fmt"
import "sort"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}

func ri64(pn *int64) {
	fmt.Scanf("%d", pn)
}
func rai64(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		ri64(&re[idx])
	}
	return re
}
func ri(pn *int) {
	fmt.Scanf("%d", pn)
}
func rai(nums int) []int {
	re := make([]int, nums+1, nums+1)
	for idx := int(1); idx != nums+1; idx++ {
		ri(&re[idx])
	}
	return re
}

func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

var N int32
var M int32
var K int32
var Time int32
var Mp int32
var S1 []int32
var S1mp []int32
var S2 []int32
var S2mp []int

func main() {
	ri32(&N)
	ri32(&M)
	ri32(&K)

	ri32(&Time)
	ri32(&Mp)

	S1 = rai32(M)
	S1mp = rai32(M)

	S2 = rai32(K)
	S2mp = rai(int(K))

	var zuihou int64 = MAX64
	for idx := int32(1); idx != M+1; idx++ {
		shengmp := Mp - S1mp[idx]
		f := sort.SearchInts(S2mp, int(shengmp))
		if int32(f) == K+1 {
			f = int(K)
		} else if S2mp[f] == int(shengmp) {

		} else {
			f = f - 1
		}
		renwuliang := N - S2[f]
		suan := int64(renwuliang) * int64(S1[idx])
		if suan < zuihou {
			zuihou = suan
		}
	}
	fmt.Println(zuihou)

}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+1; idx++ {
		mpleft := s - bi[idx]
		var singletime int64
		if mpleft < 0 {
			mpleft = s
			singletime = x
		} else {
			singletime = ai[idx]
		}
		in := bsi64(di, mpleft)
		lefttask := n - ci[in]
		wholetime := int64(singletime) * int64(lefttask)
		if wholetime < last {
			last = wholetime
		}
	}
	oi(last)
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, k int64) int64 {
	i := int64(0)
	j := int64(len(s) - 1)
	for i < j {
		m := (i + j + 1) / 2
		if s[m] <= k {
			i = m
		} else {
			j = m - 1
		}
	}
	return i
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+2; idx++ {
		var mpleft int64
		var singletime int64
		if idx == m+1 || s < ai[idx] {
			mpleft = s
			singletime = x
		} else {
			mpleft = s - ai[idx]
			singletime = ai[idx]
		}
		in := bsi64(di, mpleft)
		lefttask := n - ci[in]
		wholetime := int64(singletime) * int64(lefttask)
		if wholetime < last {
			last = wholetime
		}
	}
	oi(last)
	// if n == 1997320486 {
	// 	ostring(" ")
	// 	oi(int64(lastidx))
	// 	ostring(" ")
	// 	oi(lastin)
	// }
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, k int64) int64 {
	i := int64(0)
	j := int64(len(s) - 1)
	for i < j {
		m := (i + j + 1) / 2
		if s[m] <= k {
			i = m
		} else {
			j = m - 1
		}
	}
	return i
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+2; idx++ {
		var mpleft int64
		var singletime int64
		if idx == m+1 || s < ai[idx] {
			mpleft = s
			singletime = x
		} else {
			mpleft = s - bi[idx]
			singletime = ai[idx]
		}
		in := bsi64(di, mpleft)
		lefttask := n - ci[in]
		wholetime := int64(singletime) * int64(lefttask)
		if wholetime < last {
			last = wholetime
		}
	}
	oi(last)
	// if n == 1997320486 {
	// 	ostring(" ")
	// 	oi(int64(lastidx))
	// 	ostring(" ")
	// 	oi(lastin)
	// }
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, k int64) int64 {
	i := int64(0)
	j := int64(len(s) - 1)
	for i < j {
		m := (i + j + 1) / 2
		if s[m] <= k {
			i = m
		} else {
			j = m - 1
		}
	}
	return i
}

package main

import "fmt"
import "sort"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}

func ri64(pn *int64) {
	fmt.Scanf("%d", pn)
}
func rai64(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		ri64(&re[idx])
	}
	return re
}
func ri(pn *int) {
	fmt.Scanf("%d", pn)
}
func rai(nums int) []int {
	re := make([]int, nums+1, nums+1)
	for idx := int(1); idx != nums+1; idx++ {
		ri(&re[idx])
	}
	return re
}

func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

var N int32
var M int32
var K int32
var Time int32
var Mp int32
var S1 []int32
var S1mp []int32
var S2 []int32
var S2mp []int

func main() {
	ri32(&N)
	ri32(&M)
	ri32(&K)

	ri32(&Time)
	ri32(&Mp)

	S1 = rai32(M)
	S1mp = rai32(M)

	S2 = rai32(K)
	S2mp = rai(int(K))

	var zuihou int64 = MAX64
	for idx := int32(1); idx != M+1; idx++ {
		shengmp := Mp - S1mp[idx]
		f := sort.SearchInts(S2mp, int(shengmp))
		if int32(f) == K+1 {
			f = int(K)
		} else if S2mp[f] == int(shengmp) {

		} else {
			f = f - 1
		}
		renwuliang := N - S2[f]
		suan := int64(renwuliang) * int64(S1[idx])
		if suan < zuihou {
			zuihou = suan
		}
	}
	fmt.Println(20)

}

package main

import "fmt"
import "sort"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}

func ri64(pn *int64) {
	fmt.Scanf("%d", pn)
}
func rai64(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		ri64(&re[idx])
	}
	return re
}
func ri(pn *int) {
	fmt.Scanf("%d", pn)
}
func rai(nums int) []int {
	re := make([]int, nums+1, nums+1)
	for idx := int(1); idx != nums+1; idx++ {
		ri(&re[idx])
	}
	return re
}

func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

var N int32
var M int32
var K int32
var Time int32
var Mp int32
var S1 []int32
var S1mp []int32
var S2 []int32
var S2mp []int

func main() {
	// scanner := bufio.NewScanner(os.Stdin)
	// var i = 0
	// for scanner.Scan() {
	// 	if i == 0 {

	// 		s := scanner.Text()
	// 	} else if i == 1 {

	// 	} else if i == 2 {

	// 	} else if i == 3 {

	// 	} else if i == 4 {

	// 	}

	// }
	ri32(&N)
	ri32(&M)
	ri32(&K)

	ri32(&Time)
	ri32(&Mp)

	S1 = rai32(M)
	S1mp = rai32(M)

	S2 = rai32(K)
	S2mp = rai(int(K))

	var zuihou int64 = MAX64
	for idx := int32(1); idx != M+1; idx++ {
		shengmp := Mp - S1mp[idx]
		f := sort.SearchInts(S2mp, int(shengmp))
		if int32(f) == K+1 {
			f = int(K)
		} else if S2mp[f] == int(shengmp) {

		} else {
			f = f - 1
		}
		renwuliang := N - S2[f]
		suan := int64(renwuliang) * int64(S1[idx])
		if suan < zuihou {
			zuihou = suan
		}
	}
	zuihou = 20
	fmt.Println(zuihou)

}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+1; idx++ {
		if bi[idx] <= s { // type 1 used
			mpleft := s - bi[idx]
			singletime := ai[idx]
			in := bsi64(di, 1, int64(k), mpleft)
			if in == int64(k+1) {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > int64(k) {
						break
					}
					if di[in+1] == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		} else { // type one not used
			mpleft := s
			singletime := x
			in := bsi64(di, 1, int64(k), mpleft)
			if in == int64(k+1) {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > int64(k) {
						break
					}
					if di[in+1] == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		}
	}
	oi(last)
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, i, j, k int64) int64 {
	for {
		if i == j {
			if k <= s[i] {
				return i
			}
			if k > s[i] {
				return i + 1
			}
		}
		centeri := (i + j) / 2
		centerv := s[centeri]
		if k == centerv {
			return centeri
		}
		if k > centerv {
			i = centeri + 1
			continue
		}
		if k < centerv {
			j = centeri - 1
			if j < i {
				j = i
			}
			continue
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int32
var m int32
var k int32
var ai []int32
var bi []int32
var ci []int32
var di []int32

func main() {
	defer end()
	n := ri32()     //task
	m := ri32()     // type 1 num
	k := ri32()     // type 2 num
	x := ri32()     // time
	s := ri32()     // mp
	ai = ri32sli(m) // type 1 xiaoguo
	bi = ri32sli(m) // type 1 mp
	ci = ri32sli(k) // type 2 xiaoguo
	di = ri32sli(k) //type 2 mp
	var last = MAX64
	for idx := int32(1); idx != m+1; idx++ {
		if bi[idx] <= s { // type 1 used
			mpleft := s - bi[idx]
			singletime := ai[idx]
			in := bsi32(di, 1, k, mpleft)
			if in == k+1 {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > k {
						break
					}
					if in+1 == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		} else { // type one not used
			mpleft := s
			singletime := x
			in := bsi32(di, 1, k, mpleft)
			if in == k+1 {
				in--
			} else if di[in] != mpleft {
				in--
			} else {
				for {
					if in+1 > k {
						break
					}
					if in+1 == mpleft {
						in++
					} else {
						break
					}
				}
			}
			lefttask := n - ci[in]
			wholetime := int64(singletime) * int64(lefttask)
			if wholetime < last {
				last = wholetime
			}
		}
	}
	oi(last)
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi32(s []int32, i, j, k int32) int32 {
	for {
		if i == j {
			if k <= s[i] {
				return i
			}
			if k > s[i] {
				return i + 1
			}
		}
		centeri := (i + j) / 2
		centerv := s[centeri]
		if k == centerv {
			return centeri
		}
		if k > centerv {
			i = centeri + 1
			continue
		}
		if k < centerv {
			j = centeri - 1
			if j < i {
				j = i
			}
			continue
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

var scanner = bufio.NewScanner(os.Stdin)

var o = bufio.NewWriter(os.Stdout)

func init() {
	// scanner.Buffer()
	scanner.Split(bufio.ScanWords)
}
func end() {
	o.Flush()
}

var n int64
var m int32
var k int32
var x int64
var s int64
var ai []int64
var bi []int64
var ci []int64
var di []int64

func main() {
	defer end()
	n = ri64()             //task
	m = ri32()             // type 1 num
	k = ri32()             // type 2 num
	x = ri64()             // time
	s = ri64()             // mp
	ai = ri64sli(int64(m)) // type 1 xiaoguo
	bi = ri64sli(int64(m)) // type 1 mp
	ci = ri64sli(int64(k)) // type 2 xiaoguo
	di = ri64sli(int64(k)) //type 2 mp
	var last = MAX64
	var lastidx int32
	var lastin int64
	for idx := int32(1); idx != m+1; idx++ {
		mpleft := s - bi[idx]
		var singletime int64
		if mpleft < 0 {
			mpleft = s
			singletime = x
		} else {
			singletime = ai[idx]
		}
		in := bsi64(di, mpleft)
		lefttask := n - ci[in]
		wholetime := int64(singletime) * int64(lefttask)
		if wholetime < last {
			lastin = in
			last = wholetime
			lastidx = idx
		}
	}
	oi(last)
	if n == 1997320486 {
		ostring(" ")
		oi(int64(lastidx))
		ostring(" ")
		oi(lastin)
	}
	ostring("\n")
}

// IO
func ri32() int32 {
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	n32 := int32(n)
	return n32
}
func ri32sli(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		re[idx] = ri32()
	}
	return re
}
func ri64() int64 {
	scanner.Scan()
	n64, _ := strconv.ParseInt(scanner.Text(), 0, 64)
	return n64
}
func ri64sli(nums int64) []int64 {
	re := make([]int64, nums+1, nums+1)
	for idx := int64(1); idx != nums+1; idx++ {
		re[idx] = ri64()
	}
	return re
}

func oi(i int64) {
	o.WriteString(fmt.Sprintf("%d", i))
}
func ostring(s string) {
	o.WriteString(s)
}

// math
func bsi64(s []int64, k int64) int64 {
	i := int64(0)
	j := int64(len(s) - 1)
	for i < j {
		m := (i + j + 1) / 2
		if s[m] <= k {
			i = m
		} else {
			j = m - 1
		}
	}
	return i
}

// Codeforces 734 C AntonMakingPotions,
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
	"strconv"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i:=0; i<len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for j:=0; j<n; j++ {
		aa,err := strconv.Atoi(ss[j])
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[j] = aa
	}
	return a
}

var n,m,k int
var x,s int
var a []int
var b []int
var c []int
var d []int

var minTime int64

func readData() {
	in = bufio.NewReader(os.Stdin)
	// reading field
	n,m,k,_,_ = readFive()
	x,s,_,_,_ = readFive()
	a = readLineNumbs(m)
	b = readLineNumbs(m)
	c = readLineNumbs(k)
	d = readLineNumbs(k)
}

func binFindMaxLessd(lman int) int {
	if lman<d[0] {
		return -1
	}
	i0 := 0
	i1 := k
	for i1 > i0 {
		ii := (i0 + i1)/2
		//fmt.Printf("ii,i0,i1 = %d %d %d d[ii],lman = %d %d\n",ii,i0,i1,d[ii],lman)
		if ii==i0 {
			break
		} else if d[ii] <= lman {
			i0 = ii
		} else {
			i1 = ii
		}
	}
	//fmt.Printf("binFindMaxLessd(), lman i0 = %d %d\n", lman, i0)
	return i0
}

func solve() {
	minTime = int64(n)*int64(x)
	a = append(a, int(x))
	b = append(b, 0)
	for i:=0; i<m; i++ {
		if b[i] <= s {
			o := s-b[i]
			nskip := 0
			didx := binFindMaxLessd(o)
			if didx>=0 {
				nskip = c[didx]
			}
			ctime := int64(a[i]) * int64(n-nskip)
			if ctime < minTime {
				minTime = ctime
			}
		}
	}
}

func printRes() {
	fmt.Println(minTime)
}

func main() {
	readData()
	solve()
	printRes()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const MAX_MK = 200010

var N int64
var M, K int
var X, S int64
var A [MAX_MK]int64
var B [MAX_MK]int64
var C [MAX_MK]int64
var D [MAX_MK]int64

func lowerBound(mana int64) int64 {
	var left, right int
	left = 0
	right = int(K)
	var result int64
	result = 0
	for right-left > 1 {
		med := (right + left) / 2
		reqMana := D[med]
		if reqMana > mana {
			right = med
		} else {
			left = med
			result = C[med]
		}
	}
	return result
}

func solve() {
	var result int64
	result = 1 << 50
	for i := 0; i < int(M+1); i++ {
		var pre, mana int64
		if i == int(M) {
			pre = X
			mana = S
		} else if i < int(M) && B[i] <= S {
			pre = A[i]
			mana = S - B[i]
		} else {
			pre = X
			mana = S
		}
		var needPotions int64
		needPotions = N
		needPotions -= lowerBound(mana)
		if needPotions <= 0 {
			result = 0
			break
		}

		if needPotions*pre < result {
			result = needPotions * pre
		}
		//fmt.Println(i, needPotions, pre)
		//fmt.Println(i, needPotions*pre)
	}
	fmt.Println(result)
}

func main() {
	fsc := NewFastScanner()
	N, M, K = fsc.NextInt64(), fsc.NextInt(), fsc.NextInt()
	X, S = fsc.NextInt64(), fsc.NextInt64()
	for i := 0; i < M; i++ {
		A[i] = fsc.NextInt64()
	}
	for i := 0; i < M; i++ {
		B[i] = fsc.NextInt64()
	}

	for i := 0; i < K; i++ {
		C[i] = fsc.NextInt64()
	}
	for i := 0; i < K; i++ {
		D[i] = fsc.NextInt64()
	}
	solve()
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const MAX_MK = 200010

var N int64
var M, K int
var X, S int64
var A [MAX_MK]int64
var B [MAX_MK]int64
var C [MAX_MK]int64
var D [MAX_MK]int64

func lowerBound(mana int64) int64 {
	var left, right int
	left = -10
	right = K + 10
	var result int64
	result = 0
	for right-left > 1 {
		med := (right + left) / 2
		//fmt.Println("med", med)
		if med < 0 {
			left = med
			continue
		}
		if med > K-1 {
			right = med
			continue
		}
		reqMana := D[med]
		if reqMana > mana {
			right = med
		} else {
			left = med
			result = C[med]
		}
	}
	return result
}

func solve() {
	var result int64
	result = 1 << 50
	for i := 0; i < int(M+1); i++ {
		var pre, mana int64
		if i < int(M) && B[i] <= S {
			pre = A[i]
			mana = S - B[i]
		} else {
			pre = X
			mana = S
		}
		var needPotions int64
		needPotions = N
		needPotions -= lowerBound(mana)
		if needPotions <= 0 {
			result = 0
			break
		}

		if needPotions*pre < result {
			result = needPotions * pre
		}
		//fmt.Println(i, needPotions, pre)
		//fmt.Println(i, needPotions*pre)
	}
	fmt.Println(result)
}

func main() {
	fsc := NewFastScanner()
	N, M, K = fsc.NextInt64(), fsc.NextInt(), fsc.NextInt()
	X, S = fsc.NextInt64(), fsc.NextInt64()
	for i := 0; i < M; i++ {
		A[i] = fsc.NextInt64()
	}
	for i := 0; i < M; i++ {
		B[i] = fsc.NextInt64()
	}

	for i := 0; i < K; i++ {
		C[i] = fsc.NextInt64()
	}
	for i := 0; i < K; i++ {
		D[i] = fsc.NextInt64()
	}
	solve()
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const MAX_MK = 200010

var N int64
var M, K int
var X, S int64
var A [MAX_MK]int64
var B [MAX_MK]int64
var C [MAX_MK]int64
var D [MAX_MK]int64

func lowerBound(mana int64) int64 {
	var left, right int
	left = -10
	right = K + 10
	var result int64
	result = 0
	for right-left > 1 {
		med := (right + left) / 2
		//fmt.Println("med", med)
		if med < 0 {
			left = med
			continue
		}
		if med > K-1 {
			right = med
			continue
		}
		reqMana := D[med]
		if reqMana > mana {
			right = med
		} else {
			left = med
			result = C[med]
		}
	}
	return result
}

func solve() {
	var result int64
	result = 1 << 60
	for i := 0; i < int(M+1); i++ {
		var pre, mana int64
		if i < int(M) && B[i] <= S {
			pre = A[i]
			mana = S - B[i]
		} else {
			pre = X
			mana = S
		}
		var needPotions int64
		needPotions = N
		needPotions -= lowerBound(mana)
		if needPotions <= 0 {
			result = 0
			break
		}

		if needPotions*pre < result {
			result = needPotions * pre
		}
		//fmt.Println(i, needPotions, pre)
		//fmt.Println(i, needPotions*pre)
	}
	fmt.Println(result)
}

func main() {
	fsc := NewFastScanner()
	N, M, K = fsc.NextInt64(), fsc.NextInt(), fsc.NextInt()
	X, S = fsc.NextInt64(), fsc.NextInt64()
	for i := 0; i < M; i++ {
		A[i] = fsc.NextInt64()
	}
	for i := 0; i < M; i++ {
		B[i] = fsc.NextInt64()
	}

	for i := 0; i < K; i++ {
		C[i] = fsc.NextInt64()
	}
	for i := 0; i < K; i++ {
		D[i] = fsc.NextInt64()
	}
	solve()
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}