Teo_Yanchev

Hospital

Jul 2nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. period = int(input())
  2.  
  3. doctors = 7
  4. treated_patients = 0
  5. untreated_patients = 0
  6.  
  7. for days in range(1, period+1):
  8. patients = int(input())
  9. if days % 3 == 0 and untreated_patients > treated_patients:
  10. doctors += 1
  11. if doctors >= patients:
  12. treated_patients += patients
  13. elif doctors < patients:
  14. treated_patients += doctors
  15. untreated_patients += patients - doctors
  16.  
  17. print(f"Treated patients: {treated_patients}.")
  18. print(f"Untreated patients: {untreated_patients}.")
Advertisement
Add Comment
Please, Sign In to add comment