I have following system of equations: $q = wz + h + j$, $z = f_k(h+j) + h$
All variables are non-negative integers, and $q$ and $f_k$ are known. The solution of the system is given by: $w = \lfloor \frac qz\rfloor$, $h = z - f_k(q \pmod z)$, $ j = (q \pmod z) -h$.
How to get to this solution? I am not sure.
P.S. By $(q \pmod z)$ I mean by remainder left after dividing q by z, sorry for my bad typing.