Find the minimum and maximum amount
to buy all N candies
In a candy store there are N different types of
candies available and the prices of all the N
different types of candies are provided. There
is also an attractive offer by candy store. We
can buy a single candy from the store and get
at-most K other candies (all are different
types) for free
1. Find minimum amount of money we have
to spend to buy all the N different candies.
2. Find maximum amount of money we have
to spend to buy all the N different candies
In both the cases we must utilize the offer
and get maximum possible candies back. If k
or more candies are available, we must take k
candies for every candy purchase. If less than
k candies are available, we must take all
candies for a candy purchase if less then k candy available, we must take all candies for a candy purchase?
Answers
Answered by
1
Answer:
any bro do you think that anyone will answer this such a long question ....... sorry bro ....but u can follow me ....
Similar questions