#K76322. Magical Orb Production
Magical Orb Production
Magical Orb Production
You are given three integers m, n, and E, representing the magical energy required per spell cast, the number of magical orbs generated per cast, and the total amount of available magical energy, respectively.
The goal is to compute the maximum number of magical orbs that can be produced. The number of spells that can be cast is given by \(k = \lfloor E/m \rfloor\) when \(m > 0\). If \(m = 0\), then the spell can be cast infinitely many times, and for the purpose of this problem, we assume the result is \(E \times n\).
Formally, the answer is:
\[ \text{result} = \begin{cases} E \times n, & \text{if } m = 0, \\ \left\lfloor \frac{E}{m} \right\rfloor \times n, & \text{if } m > 0. \end{cases} \]Ensure your solution reads the input from standard input (stdin) and writes the result to standard output (stdout).
inputFormat
The input consists of a single line containing three space-separated integers:
- m: the magical energy required per spell cast.
- n: the number of magical orbs produced per spell cast.
- E: the total available magical energy.
You can assume that these integers are non-negative.
outputFormat
Output a single integer on one line: the maximum number of magical orbs that can be produced.
## sample5 10 45
90