solve loading-cargo, with dp