Advertisement
Guest User

Christmas Spirit

a guest
Jan 18th, 2020
152
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. days = int(input())
  3. cost = 0
  4. Christmas_spirit = 0
  5. day_count = 1
  6.  
  7. while day_count < days:
  8.     if day_count % 2 == 0:
  9.         cost += quantity * 2
  10.         Christmas_spirit += 5
  11.  
  12.     if day_count % 3 == 0:
  13.         cost += (quantity * 5) + (quantity * 3)
  14.         Christmas_spirit += 13
  15.  
  16.     if day_count % 5 == 0:
  17.         cost += quantity * 15
  18.         Christmas_spirit += 17
  19.  
  20.     if day_count % 15 == 5 and days % 15 == 3:
  21.         Christmas_spirit += 30
  22.  
  23.     if day_count % 10 == 0:
  24.         cost += 23
  25.         Christmas_spirit -= 20
  26.  
  27.     if day_count % 11 == 0:
  28.         quantity += 2
  29.  
  30.     day_count += 1
  31.  
  32. if days == 10:
  33.     Christmas_spirit -= 30
  34.  
  35. print(f"Total cost: {cost}")
  36. print(f"Total spirit: {Christmas_spirit}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement