Problem: You are playing a famous computer game (that just works) where you have various skills you can level up. Today, you focused on the "Smithing" skill. Your tactic is obvious: forging weapons from ingots and then melting them back to return the materials partially. For simplicity, every time you create an item, you get experience point, and every time you melt an item, you also get experience point.
There are classes of weapons you can forge and types of metal ingots.
You can create one weapon of the -th class, spending ingots of metal of the same type. Melting a weapon of the -th class (which you crafted earlier) returns you ingots of the type of metal it was made of.
You have metal ingots of the -th type, and you know that you can craft a weapon of any class from any metal type. Each combination of a weapon class and a metal type can be used any number of times.
What is the maximum total amount of experience you can earn by crafting and melting weapons?
Input Format: The first line contains two integers and () — the number of weapon classes and metal types.
The second line contains integers (), where is the number of ingots you need to forge one weapon of the -th class.
The third line contains integers (), where is the number of ingots you return by melting one weapon of the -th class you forged earlier.
The fourth line contains integers () — the number of ingots you have of the corresponding metal type.
Output Format: Print one integer — the maximum total experience points you can gain by repeatedly forging and melting weapons.
Note: In the first example, you can do the following:
- craft one weapon of the -st class from the -st type of metal, spending ingots;
- melt that weapon, returning ingots of the -st metal type;
- again, craft and melt one weapon of the -st class from the -st metal type;
- craft and melt one weapon of the -rd class from the -st metal type;
- craft and melt one weapon of the -rd class from the -rd metal type;
- craft and melt one weapon of the -th class from the -st metal type;
- craft and melt one weapon of the -th class from the -rd metal type;