Back
Close
  • 1765

What will I learn?

In this puzzle, you have to manipulate large lists and use simple math concepts (e.g. min, max, average) to optimize the value of a variable.

External resources

Greedy algorithm

Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

Statement

Given a list of persons and their budgets, and the price of the present they wish to buy, you have to find the amount each person gives. You have to find this optimal distribution that minimize the highest contribution.

A higher resolution is required to access the IDE

Story

This exercise is the first presented for the challenge « Doctor Who ». If you like it and want to try some harder puzzle, an other puzzle is available with this theme, « Music Scores »