Write a program that, given different words and a number , prints all the ways to share the words between subsets.
Input consists of a natural number , followed by , followed by a natural number .
Print all the ways to share the words between subsets. The elements of each set must appear in the same order than in the input. Print an empty line after each partition.
Strictly speaking, a partition cannot have empty subsets, but we forget about that restriction in this exercise.
You can print the solutions to this exercise in any order.
Input
2 hello bye 2
Output
subset 1: {hello,bye}
subset 2: {}
subset 1: {hello}
subset 2: {bye}
subset 1: {bye}
subset 2: {hello}
subset 1: {}
subset 2: {hello,bye}