Computer Science, asked by armysudalai, 6 months ago

A gathering of friends need to purchase chocolates. The shopkeeper
wants to maximize his number of new customers and the money he
makes. To do this, he decides he'll multiply the price of each chocolate
by the number of that customer's previously purchased chocolates plus
1. The first chocolate will be original price (0+1)*original price, the next
will be (1+1)*original price and so on.
Given the size of the group of friends, the number of chocolates they
want to purchase and the original prices of the chocolates, determine
the minimum cost to purchase all of the chocolates,
For example, if there are k=3 friends that want to buy n=4 chocolates
that cost c=[1,2,3,4] each will buy one of the chocolates priced [2,3,4] at
the original price. Having each purchased x=1 chocolate, the first
flower in the list.c[0], will now cost (current purchase + previous
purchase) *c[0] =(1+1)*1 = 2 . The total cost will be 2+3+4+2=11.​

Answers

Answered by 2017092
2

Answer:

aert s

Explanation:

1. The first chocolate will be original price (0+1)*original price, the next

will be (1+1)*original price and so on.

Given the size of the group of friends, the number of chocolates they

want to purchase and the original prices of the chocolates, determine

the minimum cost to purchase all of the chocolates,

For example, if there are k=3 friends that want to buy n=4 chocolates

that cost c=[1,2,3,4] each will buy one of the chocolates priced [2,3,4] at

the original price. Having each purchased x=1 chocolate, the first

flower in the list.c[0], will now cost (current purchase + previous

purchase) *c[0] =(1+1)*1 = 2 . The total cost will be 2+3+4+2=11.​

gasgs rh gasgs sr srthsrd rtsrat

Similar questions