Bags and boxes P75142


Statement
 

pdf   zip

You have nn distinct objects, xx identical bags, and yy identical boxes. In how many ways is it possible to distribute the objects into the bags and the boxes so that each bag has at least one object, and each box has exactly one object?

Input

Input consists of several test cases, each one consisting of nn, xx and yy. Assume 1n251 \le n \le 25, 0x250 \le x \le 25, and 0y250 \le y \le 25.

Output

For every test case, print the number of ways to distribute nn distinct objects into xx identical bags and yy identical boxes so that each bag has at least one object, and each box has exactly one object. You can assume that the answer is never larger than 510185 \cdot 10^{18}.

Public test cases
  • Input

    4 0 4
    4 1 0
    4 2 0
    4 4 0
    4 1 2
    4 0 3
    25 9 2
    

    Output

    1
    1
    7
    1
    6
    0
    3696020643539070000
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++ Python