Program solves Accessory Collection problem from HackerRank
Program solves Accessory Collection problem from HakerRank
Problem: Victoria is purchasing accessories at a store. Each store stocks A types of accessories. The i^th accessory costs i dollars (1<=i<=A). Assume an item's type identifier is the same as its cost and there is an ulimited amount of each accessory. Vicotria wants to purchase a total of L accessories according to the following rule: Any N-element subset of the purchased items must contain at least D different types of accessories.
Given L, A, N, and D values for T shopping trips, find and print the maximum amount of money that Victoria can spen during each trip. Output SAD if it is not possible for Victoria to make a purchase on a given trip. Anwer for each trip is printed on a new line.