Problem B
Source to Sink
The city recently built a shallow flood reservoir that is $\ell $ meters long, $w$ meters wide, and $1$ meter tall. It has one outflow pipe with total volume $v$ cubic meters, and two valves connecting one end of the pipe to the bottom reservoir and the other end to the general water system. Due to a recent flooding incident it was deemed unsafe to have both valves open at the same time, as such the system was altered to allow at most one valve to be open at a time. The city is wasting a lot of electricity opening and closing these valves so they have come to you to figure out the minimum amount of times valves must be opened and closed to completely empty a full reservoir to the general water system with both valves intially closed.
Input
The first and only line of input contains three space seperated integers, the length of the reservoir $1 \leq \ell \leq 100\, 000$, the width of the reservoir $1 \leq w \leq 100\, 000$, and the volume of the pipe $1 \leq v \leq 10\, 000\, 000$.
Output
Output a single integer representing the minimum number of valve operations (open and close) required to empty a full reservoir to the general water system with both valves initially closed.
| Sample Input 1 | Sample Output 1 |
|---|---|
10 10 5 |
79 |
| Sample Input 2 | Sample Output 2 |
|---|---|
6 7 8 |
23 |
