simple 0-1 bag problem
construct the nearest M