For A = 18, B = 54 and $C = {-53, 53}$
$$R = A \times B + C$$
I can retrieve A and C from R with: $$ A = \lfloor R \div B \rfloor $$ $$ C={R} \pmod {B} $$ example, A = 18, C = 53: $$ R = 18 \times 54 + 53 $$ found A and C: $$ A = \lfloor {1025} \div {54} \rfloor = {18} $$ $$ C = {1025} \pmod {54} = {53} $$ But if C is negative the result if false, A = 18, C = -53: $$ R= 18 \times 54 - 53 $$ $$ A = \lfloor {919} \div {54} \rfloor = {17} $$ $$ C = {919} \pmod {54} = {1} $$ How can I retrive A =18 and C = -53 ?
$$A=\left\lceil 919/54\right\rceil =18$$ For, C$$1\equiv1-54\equiv -53(\mod 54)$$