There are three types of fruits t1 t2 t3 in a shop gives energy 2, 3 and 5 respectivelyt the number of fruits of type t1 ,t2 and t3 are cnt1, cnt2 and cnt3 respectively and each fruit cost cost1, cost2 and cost3 respectively you want to get total of s energy by buying some of the fruits but you want to spendas less as possible so, find the minimum amount you want to spend
Answers
Answer:
Explanation:
There are three types of fruits t1 t2 t3 in a shop gives energy 2, 3 and 5 respectivelyt the number of fruits of type t1 ,t2 and t3 are cnt1, cnt2 and cnt3 respectively and each fruit cost cost1, cost2 and cost3 respectively you want to get total of s energy by buying some of the fruits but you want to spendas less as possible so, find the minimum amount you want to spend
Let say t1 ,t2 and t3 fruits quanity is purchased for t1 ,t2 and t3 respectively
Then
t1 ≤ cnt1
t2≤ cnt2
t3 ≤ cnt3
Energy E = 2t1 + 3t2 + 5t3
E ≥ S
Cost = Cost1 * t1 + Cos2 * t2 + Cost3 * t3
Cost should be minimum
We need to fins solution fulfilling all the given conditions
2, 3 and 5 are the energy levels given by 3 fruits in a shop T1, T2 and T3 And the cost of these fruits of the shop are given by cost T1, cost T2 and cost T3 respectively. The number of roots of all three types are also given as count T1 count t2 and count T3.
Now energy S = 2 T1 + 3T2 + 5T3
And minimum cost C = 2 cost1xT1+ costxxT2+ cost3xT3