Search package plans and resolve a tie

A school club needs at least 23 reusable tool trays. Small packages contain 4 trays and cost $32 each. Large packages contain 7 trays and cost $48 each. Packages cannot be split, and there are no other charges or purchase limits.


The club wants the lowest total cost. If several plans have that cost, it chooses the plan with the fewest trays beyond the required 23.


Six small packages provide one feasible plan. Use that plan's cost as an initial spending limit for a search. Check every nonnegative whole-number count of large packages whose cost alone does not exceed this limit. For each count, select the smallest nonnegative number of small packages that supplies enough trays.


Find all five requested quantities:

  • The largest large-package count checked under the initial spending limit, as an exact integer.
  • The number of distinct plans tied for the lowest cost before applying the extra-tray rule, as an exact integer.
  • The small-package count in the selected plan, as an exact integer.
  • The large-package count in the selected plan, as an exact integer.
  • The selected plan's total cost, in dollars to two decimal places.
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Problem Solving and Algorithms Questions: