Problem 2931 · Hard

Maximum Spending After Buying Items

Each shop offers its cheapest item last, so buying every price in ascending order and multiplying by the day maximises the total.

Open the interactive visualisation