A problem regarding Extended Euclidean Algorithm
Here are some ideas to get you started.


A number $n$ cannot be represented as a linear combination of $n_1,n_2$ unless $(n_1,n_2) \mid n$, since all linear combinations of $n_1,n_2$ are multiples of $(n_1,n_2)$.
The extended Euclidean algorithm gives you values $a_1,a_2$ such that $a_1n_1+a_2n_2 = (n_1,n_2)$, and in particular $$\frac{n}{(n_1,n_2)} a_1 n_1 + \frac{n}{(n_1,n_2)} a_2 n_2 = n.$$
If $n = b_1 n_1 + b_2 n_2$ then all other representations are of the form $$n = \left(b_1 + \frac{n_2}{(n_1,n_2)} t \right) n_1 + \left(b_2 - \frac{n_1}{(n_1,n_2)} t \right) n_2.$$


Try to use these ideas to solve the problem on your own.