sibinasto

2. Biscuits

Mar 4th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. import math
  2.  
  3. biscuits_per_day_and_worker = int(input())
  4. workers = int(input())
  5. competing_factory_biscuits = int(input())
  6.  
  7. total_biscuits = 0
  8. days_counter = 1
  9.  
  10. while days_counter < 31:
  11.     if days_counter % 3 == 0:
  12.         production = math.floor(0.75 * biscuits_per_day_and_worker * workers)
  13.         total_biscuits += production
  14.         days_counter += 1
  15.         continue
  16.     production = math.floor(biscuits_per_day_and_worker * workers)
  17.     total_biscuits += production
  18.     days_counter += 1
  19.  
  20. if total_biscuits > competing_factory_biscuits:
  21.     difference = ((total_biscuits - competing_factory_biscuits) / competing_factory_biscuits) * 100
  22.     print(f"You have produced {total_biscuits} biscuits for the past month.")
  23.     print(f"You produce {difference:.2f} percent more biscuits.")
  24. else:
  25.     difference = ((competing_factory_biscuits - total_biscuits) / competing_factory_biscuits) * 100
  26.     print(f"You have produced {total_biscuits} biscuits for the past month.")
  27.     print(f"You produce {difference:.2f} percent less biscuits.")
Advertisement
Add Comment
Please, Sign In to add comment