P15045 [UOI 2022 II Stage] Secret Letter.
Description
Cossack Beard urgently needs to send a letter containing secret information to his comrades. He comes to a shop that sells $a$ envelopes, $b$ stamps with an embroidered shirt pattern, and $c$ stamps with a baggy pants pattern.
To send a letter through the post office, Cossack Beard must buy:
- One envelope.
- One or two stamps.
Cossack Beard does not like monotonous repetition, so he buys at most one stamp of each type.
How many different ways can Cossack Beard complete the purchase?
Two purchases are considered different if there exists at least one envelope or stamp that Cossack Beard buys in one purchase but does not buy in the other.
Input Format
The first line contains three integers $a$, $b$, and $c$ $(1 \leq a, b, c \leq 500)$, representing the number of envelopes, the number of stamps with an embroidered shirt pattern, and the number of stamps with a baggy pants pattern.
Output Format
Output one number, the number of ways to buy an envelope and stamps.
Explanation/Hint
In the first sample, Cossack Beard can buy:
- One envelope and one stamp with an embroidered shirt pattern.
- One envelope and one stamp with a baggy pants pattern.
- One envelope and two stamps.
In the second sample, Cossack Beard can buy:
- One envelope and one stamp with a baggy pants pattern ($1$ way).
- One envelope and one of the two stamps with an embroidered shirt pattern ($2$ ways).
- One envelope, one stamp with a baggy pants pattern, and one of the two stamps with an embroidered shirt pattern ($2$ ways).
Translated by DeepSeek V3.
Translated by ChatGPT 5