Could Someone explain this test case


#1

2 10
16 5 54 55 36 82 61 77 66 61
31 30 36 70 9 37 1 11 68 14
the expected output is 321 and my code gives 291
I printed all the ways that the sum up to be 321 and all the subsets have 1 and 11 in them which are adjacent and hence 321 cant be the right ans
1 5 9 11 14 16 30 31 36 36 55 77
1 5 9 11 14 16 30 31 36 37 54 77
1 5 9 11 14 16 30 31 36 37 61 70
1 5 9 11 14 16 30 31 54 68 82
1 5 9 11 14 16 30 31 61 61 82
1 5 9 11 14 16 30 31 61 66 77
1 5 9 11 14 16 30 31 66 68 70
1 5 9 11 14 16 30 36 54 68 77
1 5 9 11 14 16 30 36 61 61 77
1 5 9 11 14 16 30 36 61 68 70
1 5 9 11 14 16 30 37 55 61 82
1 5 9 11 14 16 30 37 55 66 77
1 5 9 11 14 16 31 36 36 37 55 70
1 5 9 11 14 16 31 36 55 61 82
1 5 9 11 14 16 31 36 55 66 77
1 5 9 11 14 16 31 37 54 61 82
1 5 9 11 14 16 31 37 54 66 77
1 5 9 11 14 16 31 37 61 66 70
1 5 9 11 14 16 36 36 55 61 77
1 5 9 11 14 16 36 36 55 68 70
1 5 9 11 14 16 36 37 54 61 77
1 5 9 11 14 16 36 37 54 68 70
1 5 9 11 14 16 36 37 61 61 70
1 5 9 11 14 16 36 70 77 82
1 5 9 11 14 16 54 61 68 82
1 5 9 11 14 16 54 66 68 77
1 5 9 11 14 16 61 61 66 77
1 5 9 11 14 16 61 66 68 70
1 5 9 11 14 30 31 36 36 66 82
1 5 9 11 14 30 31 36 37 70 77
1 5 9 11 14 30 31 36 55 61 68
1 5 9 11 14 30 31 37 54 61 68


#3

The ways you have printed are wrong. There is no need to include 1 and 5 which are the smallest elements. 31, 70, 82, 77, 61 sums to 321