Hi there... A little mental blockage ='-(

The scenario:

1. A thief has a bag that cannot be larger than 5m^3.

2. He is a superman, and he can carry ANY amount.

3. He finds piles of valuable powders. He plans to steal them... naughty naughty.

4. Each pile is of a DIFFERENT powder, with its unique volume (in m^3), value (per gram), and

density (in grams per cm^3).

His goal is to steal as much as high bag allows (size-wise of course, cuz the weight isn't an

issue) with the highest value.

NOW, my question:

How can I determine which piles he should take?

(Yes, the obvious answer is, "take as much of the most valuable powder as he can"; yes, but how do you determine that, mathematically?

I am so hopeless at maths; please help and allow me to sleep!

Thank you