Advertisement
pacho_the_python

Untitled

Oct 16th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.73 KB | None | 0 0
  1. number_of_days = int(input())
  2.  
  3. viewed_patients_count = 0
  4. not_viewed_patients_count = 0
  5. doctors = 7
  6.  
  7. for day in range(1, number_of_days + 1):
  8.     patients = int(input())
  9.  
  10.     if day % 3 != 0:
  11.         if patients <= doctors:
  12.  
  13.             viewed_patients = patients
  14.             viewed_patients_count += viewed_patients
  15.             not_viewed_patients_count += 0
  16.         elif patients > doctors:
  17.  
  18.             viewed_patients = doctors
  19.             viewed_patients_count += viewed_patients
  20.             not_viewed_patients = patients - viewed_patients
  21.             not_viewed_patients_count += not_viewed_patients
  22.     elif day % 3 == 0 and not_viewed_patients_count <= viewed_patients_count:
  23.  
  24.         if patients <= doctors:
  25.  
  26.             viewed_patients = patients
  27.             viewed_patients_count += viewed_patients
  28.             not_viewed_patients_count += 0
  29.         elif patients > doctors:
  30.  
  31.             viewed_patients = doctors
  32.             viewed_patients_count += viewed_patients
  33.             not_viewed_patients = patients - viewed_patients
  34.             not_viewed_patients_count += not_viewed_patients
  35.     elif day % 3 == 0 and not_viewed_patients_count > viewed_patients_count:
  36.         doctors += 1
  37.         if patients <= doctors:
  38.  
  39.             viewed_patients = patients
  40.             viewed_patients_count += viewed_patients
  41.             not_viewed_patients_count += 0
  42.         elif patients >= doctors:
  43.  
  44.             viewed_patients = doctors
  45.             viewed_patients_count += viewed_patients
  46.             not_viewed_patients = patients - viewed_patients
  47.             not_viewed_patients_count += not_viewed_patients
  48.  
  49. print(f"Treated patients: {viewed_patients_count}.")
  50. print(f"Untreated patients: {not_viewed_patients_count}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement