Redirecting you to http://en.wikipedia.org/wiki/Subset_sum_problem