asibin2000
Programmer
I have a unique problem that I need to code and I just can't get my head around it.
I have a list in descending order:
Points Cost Cost / Points
500 8000 16
470 7520 16
400 6400 16
350 5600 16
310 4960 16
270 4320 16
250 4000 16
210 3360 16
170 2720 16
150 2460 16.4
120 2028 16.9
100 1750 17.5
80 1432 17.9
65 1189.5 18.3
45 841.5 18.7
20 382 19.1
10 193 19.3
7 138.6 19.8
5 100.5 20.1
2 41.4 20.7
1 21.4 21.4
So the person has 300 points and I need to find out the most effective way to spend the 300 points.
So i've been breaking it down for each combination.. 270 + 20 + 10 = 300, 250+45+5 etc.. Then calculating the price based on that combination and then comparing which permutation has the best deal.
Does anyone have a formula I can use? Instead of making a massive matrix?
I know there is some match thing I can use but I just can't remember how to do it, let alone code it easily.
Any guidance would be greatly appreciated!
I have a list in descending order:
Points Cost Cost / Points
500 8000 16
470 7520 16
400 6400 16
350 5600 16
310 4960 16
270 4320 16
250 4000 16
210 3360 16
170 2720 16
150 2460 16.4
120 2028 16.9
100 1750 17.5
80 1432 17.9
65 1189.5 18.3
45 841.5 18.7
20 382 19.1
10 193 19.3
7 138.6 19.8
5 100.5 20.1
2 41.4 20.7
1 21.4 21.4
So the person has 300 points and I need to find out the most effective way to spend the 300 points.
So i've been breaking it down for each combination.. 270 + 20 + 10 = 300, 250+45+5 etc.. Then calculating the price based on that combination and then comparing which permutation has the best deal.
Does anyone have a formula I can use? Instead of making a massive matrix?
I know there is some match thing I can use but I just can't remember how to do it, let alone code it easily.
Any guidance would be greatly appreciated!