Advertisement
Spocoman

The Pyramid Of King Djoser

Jan 11th, 2022 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import math
  2.  
  3. basis = int(input())
  4. increment = float(input())
  5. step = 0
  6. stone = 0
  7. marble = 0
  8. lapis = 0
  9. gold = 0
  10.  
  11. for i in range(basis, 0, -2):
  12.     size = i * i
  13.     step += 1
  14.     if i < 3:
  15.         gold = size * increment
  16.     else:
  17.         stone += (i - 2) ** 2 * increment
  18.         decorate = (i * 4 - 4) * increment
  19.         if step % 5 != 0:
  20.             marble += decorate
  21.         else:
  22.             lapis += decorate
  23.  
  24. print(f'Stone required: {math.ceil(stone)}')
  25. print(f'Marble required: {math.ceil(marble)}')
  26. print(f'Lapis Lazuli required: {math.ceil(lapis)}')
  27. print(f'Gold required: {math.ceil(gold)}')
  28. print(f'Final pyramid height: {math.floor(step * increment)}')
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement