All Subsets

Generate all subsets (power set) of a given set of integers.

Input Format

Integer n

n space-separated integers

Output Format

Each subset in a new line (space-separated integers in ascending order)

Sample Input

2
1 2

Sample Output

(empty line)
1
2
1 2

Try Your Code

← Back to Problems List