Advertisement
kiril_1914

party_profit

Jan 19th, 2022
942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. import  math
  2. group_size_input = int(input())
  3. days = int(input())
  4.  
  5. total_group_size = group_size_input # *
  6.  
  7. total_coins = 0
  8.  
  9. counter3 = 0
  10. counter5 = 0
  11. counter10 = 0
  12. counter15 = 0
  13. for cycle in range(1, days + 1):
  14.     counter3 += 1
  15.     counter5 += 1
  16.     counter10 += 1
  17.     counter15 += 1
  18.     total_coins += 50
  19.  
  20.     if counter10 == 10:
  21.         total_group_size -= 2
  22.         counter10 = 0
  23.  
  24.     if counter15 == 15:
  25.         total_group_size += 5
  26.         counter15 = 0
  27.         if counter3 == 3:
  28.             total_coins -= total_group_size * 2
  29.     if counter5 == 5:
  30.         total_coins += total_group_size * 20
  31.         counter5 = 0
  32.     if counter3 == 3:
  33.         total_coins -= total_group_size * 5
  34.         counter3 = 0
  35.     else:
  36.         total_coins -= total_group_size * 2
  37.  
  38. coinsForEach = total_coins / total_group_size
  39. print(f"{total_group_size} companions received {math.floor(coinsForEach)} coins each.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement