Diet Plan
InterviewTime limit1sMemory limit2048 MB
Given daily milk needs P_i, M mL of milk, and K biscuits, find the maximum number of days the diet can last.
Problem
You have a diet plan for the next days (numbered from to ). During day , you need to drink exactly mL of milk. Alternatively, you can consume a biscuit instead, as a replacement for milk on that day.
Currently, you only have mL of milk and biscuits. If there is not enough milk to drink on a day and you run out of biscuits, then your diet plan stops.
Determine the maximum number of days you can maintain your diet plan.
Input
The first line consists of three integers , , (; ).
The next line consists of integers ().
Output
Output a single integer representing the maximum number of days you can maintain your diet plan.