`d // div, d %div` might be better implemented with `divmod(d, div)`, might save a few cycles.