Re: [algogeeks] shop keeper and the buyer

2011-08-14 Thread Prakash D
no one to help ?? On Sat, Aug 13, 2011 at 10:48 PM, Prakash D cegprak...@gmail.com wrote: k lets assume that there are 10 kinds of item in the shop price[]={10,20,30,40,50,60,70,80,90,100} quantity[]={5,5,5,5,5,5,5,5,5,5} say no.of items having some free discounts : 5 say p,q,r denotes

Re: [algogeeks] shop keeper and the buyer

2011-08-14 Thread rashmi i
*I GUESS THE example u have cited is a bit incomplete, as in you havent included anything for the 3rd item . If you want to buy all items then some provision for the 3rd item has to be made as well. Coreect me, if I am wrong.* On Sun, Aug 14, 2011 at 7:21 PM, Prakash D cegprak...@gmail.com wrote:

Re: [algogeeks] shop keeper and the buyer

2011-08-13 Thread Prakash D
anyone? On Fri, Aug 12, 2011 at 3:49 AM, cegprakash cegprak...@gmail.com wrote: there are n number of items available in the shop price[] {size n} gives the cost of each item and there are quantity[] {size n} means that there are quantity[i] number of i'th item the shop keeper provides

Re: [algogeeks] shop keeper and the buyer

2011-08-13 Thread Aditya Virmani
if k is fixed, sort the items according to their price, buy k cheapest items start taking the most expensive item fr free actually tht is nt a real lyf prblem, usually the dealers limit no. of free items on a single bill k i never constant, tht may create inconsistencies. On Sat,

Re: [algogeeks] shop keeper and the buyer

2011-08-13 Thread Prakash D
k lets assume that there are 10 kinds of item in the shop price[]={10,20,30,40,50,60,70,80,90,100} quantity[]={5,5,5,5,5,5,5,5,5,5} say no.of items having some free discounts : 5 say p,q,r denotes buying q nos. of p we will get one r for free.. let them be 5 4 1 2 5 1 8 2 10 9 1 10 1 5 10

[algogeeks] shop keeper and the buyer

2011-08-11 Thread cegprakash
there are n number of items available in the shop price[] {size n} gives the cost of each item and there are quantity[] {size n} means that there are quantity[i] number of i'th item the shop keeper provides some free items if you buy k nos of item i, you will get 1 item j for free (i may be equal