Advertisement
DiYane

Party Profit

Sep 19th, 2023
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. from math import floor
  2.  
  3. companions = int(input())
  4. days = int(input())
  5. total_coins = 0
  6.  
  7. for day in range(1, days + 1):
  8.     if day % 10 == 0:
  9.         companions -= 2
  10.     if day % 15 == 0:
  11.         companions += 5
  12.     if day % 3 == 0:
  13.         total_coins -= companions * 3
  14.     if day % 5 == 0:
  15.         total_coins += companions * 20
  16.         if day % 3 == 0:
  17.             total_coins -= companions * 2
  18.  
  19.     total_coins += 50
  20.     total_coins -= companions * 2
  21.  
  22. coins_per_companions = floor(total_coins / companions)
  23. print(f"{companions} companions received {coins_per_companions} coins each.")
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement