This problem is a cute and simple approach using beautiful fact of matrices transformation in the linear algebra section. a, b and c can be taken from any commutative ring with identity, often taken to be the ring of real numbers or the ring of integers .It appeared in TIFR GS 2018.