Subset - MarisaOJ: Marisa Online Judge

Subset

Time limit: 1000 ms
Memory limit: 256 MB
Given a set $S = {1, 2, \ldots, n}$, the task is to list all subsets of size $k$ in lexicographic order. ### Input - A single line contains two integers $n,k$. ### Output - List all subsets of size $k$ from set $S$ in lexicographic order. ### Constraints - $1 \le k \le n \le 20$. ### Example Input: ``` 4 2 ``` Output: ``` 1 2 1 3 1 4 2 3 2 4 3 4 ```