Ice Cream
시간 제한2초메모리 제한512 MB
최대 n개의 스쿱과 k가지 맛, 겹칠 때의 추가 점수, 스쿱당 비용이 주어질 때 총맛 나누기 총비용의 최댓값을 구한다.
문제
Ice cream is a difficult topic. You are at the ice cream store and have some trouble deciding how you want your ice cream. How many scoops? What flavours? In what order? The only way to ensure that you are making the right decisions is to approach the problem systematically. Therefore, you examine each of the flavours and estimate that the tastiness of a scoop of the th flavour is . However, you are aware that some flavours complement each other, resulting in a tastiness greater than the sum of the individual flavours, whereas others just do not go very well together. Therefore, you have estimated the additional tastiness experienced whenever a scoop of one flavour is directly on top of a scoop of another, and what happens when you put two scoops of the same flavour on top of each other. The additional tastiness experienced whenever flavour is on top of flavour is . Of course, you would like to maximize the total tastiness of your ice cream, but there are two problems.
Firstly, your stomach is, regrettably, finite. Therefore, you do not want to order more that scoops. You may order fewer scoops, if this is better.
Secondly, ice cream isn't free. Each scoop costs gold coins, and the cone costs gold coins (regardless of the number of scoops of ice cream you buy).
You would like to find the maximum possible tastiness per gold coin ratio. The store has an infinite amount of each flavour.
입력
The first line of input consists of the integers (), (), and ().
The following line consists of integers (), the tastiness of each of the flavours.
The following lines each contain integers. The th number on the th line is the additional tastiness ().
출력
If it is impossible to get an ice cream with positive tastiness, display .
Otherwise, display the largest possible value of the quotient of the tastiness and the cost of an ice cream.
Your answer will accepted if it is within a relative or absolute error of at most of the correct answer.