The Logging Company owns many sawmills. However, these sawmills currently require a human operator to function. To decrease wage expenses, the Company has hired you to write a program to replace all the humans at the sawmills.
At the sawmill, there are
Input Specification
- The first line will be
, the number of saws and logs. - The second line will contain
integers, the energy consumption of each saw, . - The third line will contain
integers, the length of each log, .
Output Specification
The first and only line of output should be the minimum total energy used on the day described by the input.
Scoring
- For cases worth 20% of the points,
for all . - For cases worth another 30% of the points,
. - For cases worth another 20% of the points,
. - For cases worth 90% of the points in total,
for all .
Sample Input 1
5
1 1 1 1 1
13 27 6 20 34
Sample Output 1
100
Sample Input 2
3
1 4 2
30 20 10
Sample Output 2
110
Comments