Multisets (2) P70914


Statement
 

pdf   zip

Write a program that, given three numbers nn, xx and yy, prints all the multisets 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.

Output

Print all the multisets 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.

Public test cases
  • Input

    2 1 4
    

    Output

    {1,2}
    {1,2,2}
    {1,2,2,2}
    {1,2,2,2,2}
    {1,1,2}
    {1,1,2,2}
    {1,1,2,2,2}
    {1,1,2,2,2,2}
    {1,1,1,2}
    {1,1,1,2,2}
    {1,1,1,2,2,2}
    {1,1,1,2,2,2,2}
    {1,1,1,1,2}
    {1,1,1,1,2,2}
    {1,1,1,1,2,2,2}
    {1,1,1,1,2,2,2,2}
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++ Python