Problems
Farmer John has received an order for exactly
- He can fill the smallest pail (of size
- He can fill the medium-sized pail (of size
Although FJ realizes he may not be able to completely fill the size-
Input
The first, and only line of input, contains
Output
Output the maximum amount of milk FJ can possibly add to the size-
Example
17 25 77
76
In this example, FJ fills the pail of size 17 three times and the pail of size 25 once, accumulating a total of 76 units of milk.