Module: Permutations


Problem

4 /5


All binary strings of length n containing exactly k ones

Problem

Given numbers N and K print all strings of zeros and units of length N that contain exactly K units, in lexicographic order.

Input
Given 2 numbers: N and (\(0 <= K <= N\), \(0 <= N <= 100\)).

Imprint
It is necessary to output all strings of zeros and ones of length N that contain exactly K ones, in lexicographic order.


Examples
# Input Output
1 4 2 0011
0101
0110
1001
1010
1100