simeonshopov

Party profit

Nov 26th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. party_size = int(input())
  2. days = int(input())
  3. coins = 0
  4.  
  5. for i in range(1, days + 1):
  6.   if i % 10 == 0:
  7.     party_size -= 2
  8.   if i % 15 == 0:
  9.     party_size += 5
  10.   coins += 50
  11.   coins -= party_size * 2
  12.   if i % 3 == 0:
  13.     coins -= party_size * 3
  14.   if i % 5 == 0:
  15.     coins += party_size * 20
  16.     if i % 3 == 0:
  17.       coins -= party_size * 2
  18.  
  19. print(f'{party_size} companions received {coins // party_size} coins each.')
Advertisement
Add Comment
Please, Sign In to add comment