Advertisement
Guest User

Christmas Spirit

a guest
Jan 18th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. quantity = int(input())
  2. days = int(input())
  3. cost = 0
  4. christmas_spirit = 0
  5. day_count = 1
  6.  
  7. while day_count <= days:
  8.     if day_count % 11 == 0:
  9.         quantity += 2
  10.  
  11.     if day_count % 2 == 0:
  12.         cost += quantity * 2
  13.         christmas_spirit += 5
  14.  
  15.     if day_count % 3 == 0:
  16.         cost += (quantity * 5) + (quantity * 3)
  17.         christmas_spirit += 13
  18.  
  19.     if day_count % 5 == 0:
  20.         cost += quantity * 15
  21.         christmas_spirit += 17
  22.  
  23.     if day_count % 5 == 0 and days % 3 == 0:
  24.         christmas_spirit += 30
  25.  
  26.     if day_count % 10 == 0:
  27.         cost += 23
  28.         christmas_spirit -= 20
  29.  
  30.     if days == 10:
  31.         christmas_spirit -= 30
  32.  
  33.     day_count += 1
  34.  
  35. print(f"Total cost: {cost}")
  36. print(f"Total spirit: {christmas_spirit}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement