Sichanov

the_biscuit_factory

Oct 24th, 2021
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. from math import floor
  2.  
  3. biscuits = int(input())
  4. workers = int(input())
  5. competitor_biscuits = int(input())
  6. total_biscuits = 0
  7.  
  8. for each_day in range(1, 31):
  9.     biscuits_per_day = workers * biscuits
  10.     if each_day % 3 == 0:
  11.         biscuits_per_day = floor(biscuits_per_day * 0.75)
  12.     total_biscuits += biscuits_per_day
  13.  
  14. print(f'You have produced {total_biscuits} biscuits for the past month.')
  15.  
  16. percentage = total_biscuits / competitor_biscuits * 100
  17.  
  18. if total_biscuits > competitor_biscuits:
  19.     print(f'You produce {percentage - 100:.2f} percent more biscuits.')
  20. else:
  21.     print(f'You produce {100 - percentage:.2f} percent less biscuits.')
  22.  
Advertisement
Add Comment
Please, Sign In to add comment