If I have a linear equation like
$$ c_1x_1 + c_2x_2 + ... + c_nx_n = m \leq M $$
with the constraint $x_i \in \mathbb{N}$ for $0 \le i \le n$, where $M$ and the $c_i$ are constants, and where the $c_i$ are rational, how do I maximize $m$?
A friend suggested looking at the least squares method, which I didn't really understand, or possibly at trying to find the least common multiple of a subset of the $c_i$ values and checking if that divides M, but that's a little more trial-and-error than I'm hoping for.
Note: I apologize if this has been answered elsewhere; I didn't see any solutions that matched this problem but I also didn't really know how to search for it.