DP subset sum with exactly M size