Advertisement
HristoBaychev

Hospital

Feb 5th, 2023
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. doctors = 7
  2.  
  3. period = int(input())
  4.  
  5. treat_patient = 0
  6. untreat_patient = 0
  7.  
  8. for medp in range(1, period+1):
  9.     new_patient = int(input())
  10.     if medp % 3 == 0 and untreat_patient > treat_patient:
  11.         doctors = doctors + 1
  12.  
  13.     if new_patient >= doctors:
  14.         treat_patient += doctors
  15.         untreat_patient += new_patient - doctors
  16.     else:
  17.         treat_patient += new_patient
  18.  
  19. print(f'Treated patients: {treat_patient:.0f}.')
  20. print(f'Untreated patients: {untreat_patient:.0f}.')
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement