A solved example from the University of California - Berkeley: https://i.ibb.co/VwpwwJc/Berkeley-Modular-Arithmetic.png https://math.berkeley.edu/~williams/55/SampleMidterm1Solutions.pdf (Page 4)