Problem Statement | |||||||||||||
| You are given the following equation:
A * x + B * y + C * z = W where x, y and z are integers greater than or equal to 0. Return the minimal possible sum x + y + z, or -1 if a solution does not exist. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | A, B, C and W will each be between 1 and 100, inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||
| 5) | |||||||||||||
| |||||||||||||