Let $a, b, c, d, e$ be nonnegative integers such that $625a + 250b + 100c + 40d + 16e = 15^3$ . What is the maximum possible value of $a + b + c + d + e$?
Quick arithmetic gives: $15^3 = 3375$.
$625a + 250b + 100c + 40d + 16e = 3375$ is the given.
The idea is to maximize $e$ because the coefficient $16$ will make $e$ very large. $\lfloor 3375/16 \rfloor = 210$. But that is impossible.
Please do not give a full answer, only hints! Thanks!
Brute Force:
This can be posed as a linear program. Renaming the unknowns to $x_i$, it is: $$ \begin{array}{ll} \max & c^\top x \\ \mbox{w.r.t.} & a^\top x = b \\ & 0 \le x \\ & x_i \in \mathbb{Z} \end{array} $$ where $$ c = (1,1,1,1,1)^\top \\ x = (x_1, x_2, x_3, x_4, x_5)^\top \\ a = (625, 250, 100, 40, 16)^\top \\ b = 15^3 $$ So it can be solved by the well-known algorithms and software.
Using R and the lpSolveAPI package:
R is a popular maths package. If not done yet, the lpSolveAPI package must be installed:
Then the library must be loaded:
We then create the model for 5 unknowns, add the objective function and constraints:
Standard sense is to minimize, but we want to maximize:
Now let us have a look:
Ah, the restrictions of the unknowns to integer are missing:
Not the bounds are set for non-negative solutions. Now solve and check the results:
Spoiler: maximum (put mouse over field to get the hidden information)
Spoiler: solution vector
What is left is how to solve this clever without machine.
What does a lp solver do?
The image shows the problem reduced to two unknowns. The constraint $a^\top x = b$ is a hyperplane (dimension $n-1$), here the dark blue line.
Together with the constraints $0 \ge x$ the feasible solutions (those that honor the constraints) are within the green triangle. As we are looking for integer solutions they are the integer grid points within the triangle.
The objective function can attain various values $s$ $$ c^\top x = s $$ This is another hyperplane, dependent on $s$. Shown are the lines for $s = 5$, $10$, $15$ and $20$.
We find the maximum by pulling that hyperplane as high (regarding $s$ value) as possible, while still touching one of the feasible solutions from the grid within the triangle.
In the continous case we would just need to inspect the points of the triangle, with the maximum attained at the top point.
In the discrete case, e.g. if the coordinate grid cross points within the triangle were the feasible solutions, we had four feasible solutions and a maximum at $(0, 10)$ with value $10$.
I do not know how the solvers are implemented for discrete unknowns. I would naively inspect all grid points within the triangle, closest to the boundary. But there might be smarter approaches.