beecrowd | 3349

Armor

By Emilio Wuerges, UFFS BR Brazil

Timelimit: 1

During winter, especially in the mountains, the weather can get very cold. On these occasions, the peão needs to prepare and dress accordingly.

Among other parts, the Bombacha, the Boot, the Hat, and the Scarf are part of the peão's clothing. Each of these parts can vary in quality and weight.

Calculate the maximum garment quality value given a maximum weight. Consider that the peão can wear 4 types of armor parts, but only one part of each type: Bombacha, the Boot, the Hat and the Scarf.

Input

The first line consists of 4 integers H, C, S, P and one rational W, the number of Bombachas, Boots, Hats and Scarves available; and the maximum load, respectively.

Then, the input contains 4 pairs of lines, containing the statistics of the types of parts in this order: Bombachas, Boots, Hats and Scarves:

The first line of each pair has the part type quality values: \(d[p][1], d[p][2] , \cdots, d[p][p_n] \).
The second line of each pair represents the weight of the part directly above: \(w[p][1], w[p][2] , \cdots, w[p][p_n] \).

Output

The output contains a single rational number, the maximum quality possible.

Limits

Input Sample Output Sample
1 1 1 1 10.1
5.0
1.0
6.0
2.0
11.0
100.0
23.0
3.0
34.0