Zeros and ones (2)

Write a program to print all the combinations of n − o zeros and o ones,
for some given n and o.

Input

Input consists of n and o, two natural numbers such that n > 0 and
0 ≤ o ≤ n.

Output

Print all the combinations of n − o zeros and o ones, one per line and
in lexicographical order.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:20:25.115Z

© Jutge.org, 2006–2026.
https://jutge.org
