GeorgiLukanov87

xmas_spirit

Apr 7th, 2022 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. quantity = int(input())
  2. total_days = int(input())
  3. total_cost = 0
  4. total_spirit = 0
  5. for day in range(1, total_days + 1):
  6.     if day % 11 == 0:
  7.         quantity += 2
  8.     if day % 2 == 0:
  9.         total_cost += 2 * quantity
  10.         total_spirit += 5
  11.     if day % 3 == 0:
  12.         total_cost += (5 * quantity) + (3 * quantity)
  13.         total_spirit += 13
  14.     if day % 5 == 0:
  15.         total_cost += 15 * quantity
  16.         total_spirit += 17
  17.         if day % 3 == 0:
  18.             total_spirit += 30
  19.     if day % 10 == 0:
  20.         total_spirit -= 20
  21.         total_cost += 5 + 3 + 15
  22.  
  23.         if day == total_days:
  24.             total_spirit -= 30
  25.  
  26. print(f"Total cost: {total_cost}")
  27. print(f"Total spirit: {total_spirit}")
  28.  
Add Comment
Please, Sign In to add comment