Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(a, b, c):
- if a + b + c == 0:
- return [""]
- result = []
- if a > 0:
- for i in f(a - 1, b, c):
- result.append(i + "2")
- if b > 0:
- for i in f(a, b - 1, c):
- result.append(i + "1")
- if c > 0:
- for i in f(a, b, c - 1):
- result.append(i + "0")
- return result
- a, b, c = list(map(int, input().split()))
- print(*sorted(f(a, b, c)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement