Re[2]: Numbers problem

new topic     » topic index » view thread      » older message » newer message

>>The knapsack in the archives is very different.
>>it uses float numbers and the goal is seek as close as possible. But I 
>>need the exact sum..
>>
p> If the knapsack in the archives does not work, and <I assume> my
p> program does not either (which *IS* exact), then, sheesh, I guess we
p> *CANNOT HELP YOU* until you give us more info!

p> Just what, exactly, are you trying to do?

But your program works correctly...
because it's different and simple to understand.

I am trying to using a 1*1 and 2*2 block to fill up a 5*5 area.
But the number of first blocks + second blocks must be 13.

Trying your program I get 9 for 1*1 and 4 for 2*2.
That is exactly what i want.

And for mcnuggets problem it also can be used:
6a + 9b + 20c = 62

Your program got:
a = 1
b = 4
c = 1

Thanks!

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu