Advertisement
ElenaSokol

party_profit

Jan 27th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. group_size = int(input())
  2. days = int(input())
  3. coins = 0
  4. companions_count = group_size
  5. condition_5th_day = False
  6.  
  7. for n in range(1, days+1):
  8.     condition_5th_day = False
  9.     coins += 50
  10.     coins -= (2 * companions_count)
  11.  
  12.     if n % 3 == 0:
  13.         coins -= (3 * companions_count)
  14.         condition_5th_day = True
  15.     elif n % 5 == 0:
  16.         coins += (20 * companions_count)
  17.         if condition_5th_day:
  18.             coins -= (2 * companions_count)
  19.     elif n % 10 == 0:
  20.         companions_count -= 2
  21.     elif n % 15 == 0:
  22.         companions_count += 5
  23. print(f"{companions_count} companions received {coins} coins each.")
  24.  
  25.  
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement