ALEXANDAR_GEORGIEV

hospital

Jun 8th, 2022 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. time_period = int(input())
  2. current_doctors = 7
  3. days = 1    # на 2-рия ден days = 3
  4. done_patients = 0
  5. un_patients = 0
  6. un_treated = 0
  7. for x in range(1, time_period + 1):
  8.     count_patients = int(input())
  9.     days += 1
  10.     if current_doctors < count_patients:
  11.         done_patients = done_patients + current_doctors
  12.         un_patients = count_patients - current_doctors
  13.         un_treated += un_patients
  14.     elif current_doctors >= count_patients:
  15.         done_patients = done_patients + count_patients
  16.     if not days % 3:    # на 2-рия ден days = 3
  17.         if un_treated > done_patients:
  18.             current_doctors += 1
  19.        
  20. print(f'Treated patients: {done_patients}.')
  21. print(f'Untreated patients: {un_treated}.')
  22.  
Add Comment
Please, Sign In to add comment