Same remainder when three integers divided