Advertisement
Andonoff

Untitled

May 23rd, 2025
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. companions = int(input())
  2. days = int(input())
  3.  
  4. coins = 0
  5. coins_for_food = companions * 2
  6. coins_for_party = companions * 3
  7. coins_from_boss = companions * 20
  8.  
  9. for day in range(1, days + 1):
  10.     if day % 10 == 0:
  11.         companions -= 2
  12.     if day % 15 == 0:
  13.         companions += 5
  14.  
  15.     coins += 50 - coins_for_food
  16.  
  17.     if day % 3 == 0:
  18.         coins -= coins_for_party
  19.  
  20.     if day % 5 == 0:
  21.         coins += coins_from_boss
  22.         if day % 3 == 0:
  23.             coins -= coins_for_food
  24.  
  25. coins_per_companion = coins // companions
  26. print(f"{companions} companions received {coins_per_companion} coins each.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement