Brilliant cut

Your task is to cut the given raw material of gemstones in a way that provides the biggest possible profit. There will be three types of gemstones: diamonds, sapphires and rubies. You get the input data here.

For each gem types, the following information is provided:

‘cuts’ => ‘size’, the size of the cut

‘cuts’ => ‘value’, the value of the cut in question

’raw chunks’, the original size of the raw, un-cut chunks

Leftover chunks or fragments cannot be combined. Leftover chunks are counted as waste and they are substracted from the resulting profit.

For example: a raw diamond chunk size 23 can be cut in the following ways:

Please send us the largest profit that may result from cutting the gems, and the source code you used.

RULES

You can use any programming language to solve the problem.

A solution must contain the right answer.

The winner will be the most elegant solution, decided by the Wundernut jury.

Performance is a part of elegance.

The participant gives Wunderdog the right to publish their solution.

The judges have now selected the winner! We have contacted the winner personally. Here is a link to the winner solution: https://github.com/wunderdogsw/wunderpahkina-vol7/blob/master/winning_solution/Program.cs . The argumentation for this solution was that it was clear and also simply put: "Because .NET and Bill are the best". Congratulations to the winner and big thanks to everyone who sent their solutions, we are always eager to see what you came up with! Until next Wundernut.

The winner will be rewarded with Philips Hue White and color ambiance starter kit.