DP problem: subset-sums solved