Division and remainder theorem