Without reading, I already knew the solution.
To solve it in your head: sort items by most value/weight efficient to least efficient.
Then take as much as you can until you're full.
(in a game like elder scrolls oblivion, that means jewelry first, and silver vases last)
-----
edit: I am mistaken, as some of the below comments accurately pointed out.