Question: Iterate and array and select x items so that they equal or above a value

How to do this in Maple please?

Iterate an array and select x items so that the sum of the selected items equal or are above a value.

Eg. 10 real numbers in an array, random for example between 0..10 and select some of them so the value is equal or greater than y, e.g 5.2 , as close as possible to optimize the selection.

Please Wait...