N= int(input())  # N=qantidade de doces
total = 0
for C in range(1, N + 1):
    if N % C == 0:
        qnt_doces_caixas = N//C
        preco_simples = 10 + 3 * qnt_doces_caixas
        preco_caixa_enfeitada = preco_simples * (2 + C)
        preco_pedido = preco_caixa_enfeitada * C 
        total += preco_pedido
print(total)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: