Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- m = int(input())
- result = []
- for i in range(1, m+1):
- for j in range(1, m+1):
- for k in range(1, m+1):
- if (i+j+k) == n:
- r = sorted([i, j, k])
- if not (r in result):
- result.append(r)
- for r in result:
- print(f"{r[0]} {r[1]} {r[2]}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement