Advertisement
PowerCell46

Party profit Python

Dec 24th, 2022
1,104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import math
  2.  
  3. group_size = int(input())
  4. days_for_the_adventure = int(input())
  5. earned_coins = 0
  6. days = 0
  7. while True:
  8.     days += 1
  9.     if days == days_for_the_adventure + 1:
  10.         break
  11.  
  12.     if days % 10 == 0:
  13.         group_size -= 2
  14.     if days % 15 == 0:
  15.         group_size += 5
  16.  
  17.     earned_coins += (50 - (group_size * 2))
  18.  
  19.     if days % 3 == 0:
  20.         earned_coins -= (group_size * 3)
  21.     if days % 5 == 0:
  22.         earned_coins += (group_size * 20)
  23.         if days % 3 == 0:
  24.             earned_coins -= (group_size * 2)
  25. coins_per_person = math.floor(earned_coins / group_size)
  26. coins_per_person = math.trunc(coins_per_person)
  27. print(f'{group_size} companions received {coins_per_person} coins each.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement