Bags and boxes

You have n distinct objects, x identical bags, and y 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 n, x and y.
Assume 1 ≤ n ≤ 25, 0 ≤ x ≤ 25, and 0 ≤ y ≤ 25.

Output

For every test case, print the number of ways to distribute n distinct
objects into x identical bags and y 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 5 ⋅ 10¹⁸.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:50:21.650Z

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