Remainder problem

Its discussed here https://forums.gregmat.com/t/questions-from-difficult-quant-questions-class-on-may-5-2021/2234/6?u=kremlinofficial