Multisets (4)

Write a program that, given four natural numbers nn, xx, yy and tt, prints all the multisets with tt numbers that can be made up with {1,,n}\{1, \dots, n\}, in such a way that every number appears between xx and yy times.

Input

Input consists of a natural number n>0n > 0, followed by a natural number x0x \ge 0, followed by a natural number y>xy > x, followed by a natural number t0t \ge 0. Assume nxtnynx \le t \le ny.

Output

Print all the multisets of size tt that can be made up with {1,,n}\{1, \dots, n\}, using each number between xx and yy times. The numbers inside each multiset must appear in non-decreasing order.

Information about the checker

You can print the solutions to this exercise in any order.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:08:33.817Z

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