P2638 Security System

Description

After Tesla’s six-digit passcode was easily cracked, people began to doubt the security of electric vehicles. Upon hearing this, Li Hua designed his own passcode system: - Suppose the security system has $n$ storage units. Each storage unit can hold up to 2 different types of signals (it may also hold none). There are two types of signals, $0$ and $1$, with $a$ copies of $0$ and $b$ copies of $1$ available. A single $0$ or $1$ counts as one signal. We need to store these signals in the storage units. The $0$ and $1$ signals do not have to be all stored; a storage unit may contain any number of $0$’s and any number of $1$’s. Every distinct storage plan, after Li Hua’s processing, will correspond to a distinct passcode. Given $n,a,b$, find the number of possible distinct storage plans.

Input Format

The first line contains 3 integers, $n,a,b$.

Output Format

The first line contains an integer, the number of plans.

Explanation/Hint

All 9 plans are as follows: | Storage unit $1$ | Storage unit $2$ | | :----------: | :----------: | | $\verb!NULL!$ | $\verb!NULL!$ | | $0$ | $\verb!NULL!$ | | $1$ | $\verb!NULL!$ | | $\verb!NULL!$ | $0$ | | $\verb!NULL!$ | $1$ | | $0,1$ | $\verb!NULL!$ | | $\verb!NULL!$ | $0,1$ | | $1$ | $0$ | | $0$ | $1$ | Constraints: For all testdata, $a,b \le 50$, $n+a \le 50$, $n+b \le 50$. --- $\text{upd 2022.10.22}$: A new set of Hack testdata was added. Translated by ChatGPT 5