How would you solve this?

Assuming you have a vector x=[16,18,23,24,39,40], create a function that when called at the command window, will display the count of random numbers(elements in vector X) needed to make a sum of 100. One should also display the combination of those random numbers.