Files
kattis/pyramids.py
2023-06-26 15:18:13 +02:00

10 lines
212 B
Python

blocks_available = int(input())
total_blocks_needed = 0
i = 0
while True:
i += 1
total_blocks_needed += (i * 2 - 1) ** 2
if total_blocks_needed > blocks_available:
print(i - 1)
exit()