#C9292. Maximum Plant Growth
Maximum Plant Growth
Maximum Plant Growth
You are given N types of plants. Each plant type i requires W_i liters of water per day to grow and yields G_i units of growth per watering. You have a limit of M liters of water available each day. You may water a plant type as many times as allowed by the water limit, and watering a plant type multiple times in one day gives cumulative growth. Over T days, the total growth for a plant type is computed as:
\(\text{Total Growth} = T \times \left(\left\lfloor\frac{M}{W_i}\right\rfloor \times G_i\right)\)
Your task is to determine the maximum growth achievable by selecting the best plant type.
inputFormat
The input is given via standard input in the following format:
N T M W[0] W[1] ... W[N-1] G[0] G[1] ... G[N-1]
Where:
- N is the number of different plant types.
- T is the number of days.
- M is the maximum liters of water available per day.
- W is a list of N integers, where each integer represents the liters of water needed per watering for each plant type.
- G is a list of N integers, where each integer represents the growth units per watering for each plant type.
outputFormat
Output a single integer which is the maximum total growth achievable over T days for one chosen plant type.
## sample3 5 10
2 3 5
4 5 10
100