Skip to content

Instantly share code, notes, and snippets.

@kaubu
Created October 28, 2023 23:00
Show Gist options
  • Save kaubu/f6df03c57859377ffefa6bee4e350b63 to your computer and use it in GitHub Desktop.
Save kaubu/f6df03c57859377ffefa6bee4e350b63 to your computer and use it in GitHub Desktop.
# 9(1)+4(2)+3(3)+2(4)+1(5)+1(6)+1(7)+1(8)+1(9)=
import math
slots: int = int(input("Slots: "))
spells = 0
for i in range(1, slots + 1):
# print(i)
new_spells = math.floor(slots / i)
spells += new_spells
# print(f"{new_spells}({i})")
print(f"Total slots: {spells}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment