Finding the amount of item combination closest to a number

Viewed 18

I having a really hard time trying to find a good C# solution and explaining this. So I will show you the math and just point me in a good direction.

61X + 84Y + 258Z > 543;

X < 20, Y < 8, Z < 4;

What would X, Y, & Z be so that it is closest to (and under >) 543; All the made-up numbers are numbers I would plug into the algorithm to get the results of X, Y, & Z.

Thank you for your time.

0 Answers
Related