Obter o quociente e o resto de uma divisão ao mesmo tempo usando o divmod de Python https://pt.from-locals.com/python-divmod-quotient-remainder/