HINT
$$50r + 30g + c = 1000\tag{1}$$
$$r+g+c = 100\tag{2}$$
Eliminating one variable gives you a linear diophantine equation in two variables whose solution is straightforward.
$$49r + 29g = 900 \tag{3}$$
Another approach which works well for this specific problem is :
$$r = \dfrac{900 - 29g}{7\times 7}$$
Since $900$ leaves a remainder of $4$ when divided by $7$,
$29g$ must also leave the remainder $4$ for $r$ to be an integer :
$$29g \equiv 4 \pmod 7 \implies g \equiv 4 \pmod 7 $$
Plugging in $g=4$ gives you $r=16$. This is one solution.
Thanks for giving an explicit example. I will try to solve in $\Bbb Z$ the equation as a human (so that the idea becomes transparent):
$$
33x+753y=183\ ,\qquad x,y\in\Bbb Z\ .
$$
(1) We note first that the g.c.d. of $33$ and $753$ is $(33,753)=3$. A necessary condition to solve is that $3$ also divides the RHS, $183$, yes, this is the case, and $183/3=61$. So we divide by $3$ in both sides and get the simpler equation:
$$
11x+251y=61\ ,\qquad x,y\in\Bbb Z\ .
$$
(2)
In the new situation, the relevant gcd is $(11,251)=1$.
We will solve first
$$
11X+251Y=1\ ,\qquad X,Y\in\Bbb Z\ .
$$
It is clear than that for each such solution $(X,Y)$ setting $x=61X$ and $y=61Y$ we get a solution of the initial equation. So let us get a particular solution $X,Y$ first.
For this, we build the continued fraction and the convergents for $251/11$, here explicitly:
$$
\frac{251}{11}
=22+\frac9{11}
=22+\frac1{11/9}
=22+\frac1{1+\frac 29}
=22+\frac1{1+\frac 1{9/2}}
=22+\frac1{1+\frac 1{4+\frac12}}
=[22;1,4,2]
\ .
$$
(This is a systematic way to use the repeated euclidean algorithm in one relation.)
The "convergents" are fractions that approximate better and better (up to given denominators) the fraction we started with.
$$
\begin{aligned}
[22;]&=22\ ,\\
[22;1]&=22+\frac 11=23\ ,\\
[22;1,4]&=22+\frac 1{1+\frac 14}=22+\frac 45=\frac{114}5\ ,\\
[22;1,4]&=\frac{251}{11}\ .
\end{aligned}
$$
The theory of continued fractions insures that the difference
of two successive convergents has as denominator the product of the denominators of the fractions in the difference, and the numerator is alternatively $\pm 1$. In our case, using computer power to make typing easier, sage:
sage: a = 251/11
sage: a.continued_fraction()
[22; 1, 4, 2]
sage: a.continued_fraction().convergents()
[22, 23, 114/5, 251/11]
sage: 22-23
-1
sage: 23-114/5
1/5
sage: 114/5-251/11
-1/55
We only need the last relation, consider in
$$
\frac{114}5-\frac {251}{11}=\frac{-1}{5\cdot 11}
$$
the computation for the numerator,
$$
11\cdot 114-251\cdot 5=-1\ ,
$$
and from it we can extract a particular solution
$$(X_0,Y_0)=(-114,5)$$
of $11X+251Y=1$.
Each other solution satisfies
$$11(X-X_0)+251(Y-Y_0)=0\ ,$$
so the only way to arrange this is $(X-X_0)=251k$, $(Y-Y_0)=-11k$, $k\in \Bbb Z$. (It is premature to apply it here, but it is good to observe it here.) Sometimes, because of this, the particular solution is (re)arranged to have the $X$-part in the range $[0,251)$ and/or the $Y$-part in the range $[0,11)$. Check:
sage: 11*(-114) + 5*251
1
(3) We pass from the particular solution for $11X+251Y=1$ above to a particular solution for $11x+251y=61$. We compute $5\cdot 61=305$, and reduce modulo $11$ to get either $8$ or $-3$. For both we get then a solution...
sage: ( 61 - 251*8 )/11
-177
sage: ( 61 - 251*(-3) )/11
74
Here is the right point to mention that any other solution for the $x$-part differs from the above special one by a multiple of $251$.
(4) This solves the problem after the division with gcd $=3$, we can take $x=74$ modulo $251$. And also the initial problem, also taking $x=74$ modulo $753$.
I did not try to do a quick expedition of the human facts for the human solution, but even if... there would have been maybe the half of the line. This is somehow too much, compared with the following solutions of the same problem:
sage: R = Zmod(251)
sage: R(61)/R(11)
74
sage: R(11)^(-1) * R(61)
74
sage: R.is_field()
True
sage: R = Zmod(753)
sage: [ x for x in R if R(33) * x == R(183) ]
[74, 325, 576]
(There are three solutions modulo $753$. We have found the $74$, the next ones are obtained by adding $251$.)
Best Answer
Let $d>0$ be the greatest common divisor of $a$ and $b$. Fix an arbitrary solution $(x_0,y_0)$ of the equation $ax+by=N$. Let $(x,y)$ be any solution of this equation. Then $a(x-x_0)+b(y-y_0)=0$, so $d(x-x_0)|b$, that is $x=x_0+kb/d$ for some integer $k$. Conversely, for any integer $k$, $(x_0+kb/d, y_0-ka/d)$ is a solution of the equation. This solution costs $c_1(x_0+ kb/d)+c_2(y_0-ka/d)$, which is $k(c_1b-c_2a)/d$ than the cost of the solution $(x_0,y_0)$. This follows that a solution of the equation with the minimum cost is: