A treasure chest has a peculiar combination lock: it opens only when a subset of the
Find every subset of coins from the pouch that weighs exactly
Each individual subset must be listed with its coin weights in non-decreasing order, and the overall list of subsets must be sorted lexicographically (comparing subsets element by element, with a shorter subset counted as smaller than a longer one that agrees with it on all shared leading elements).
The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the number of coins and the required weight.
The second line contains KaTeX can only parse string typed expression distinct positive integers — the weight of each coin.
Print a single integer on the first line — the number of qualifying subsets. Then print that many lines, each describing one subset: its size, followed by its coin weights in non-decreasing order. The subsets themselves must appear in lexicographically sorted order.
Input
5 8
2 3 5 6 8Output3
2 2 6
2 3 5
1 8ExplanationThe subsets {2,6}, {3,5}, and {8} each weigh exactly 8. Sorted lexicographically, {2,6} comes first, then {3,5}, then {8}.
Example 2:
Input
1 3
5Output0ExplanationNo subset of {5} weighs exactly 3, so the count is 0 and no subsets follow.