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, Aug 13, 2011 at 6:58 PM, Prakash D <cegprak...@gmail.com> wrote: > 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 some free items >> if you buy k nos of item i, you will get 1 item j for free (i may be >> equal to j) >> >> also there can be such offers for many items >> >> what you have to do is to buy all the items in shop with minimum >> expenditure. >> . >> >> source: own problem (i don't have the solution) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.