Advertisement
BbJLeB

02. Hospital

May 30th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. # 02. Hospital
  2.  
  3. period = int(input())
  4. doctors = 7
  5. treated_sum = 0
  6. untreated_sum = 0
  7.  
  8. for i in range(1, period + 1):
  9.     patients = int(input())
  10.  
  11.     if i % 3 == 0 and untreated_sum > treated_sum:
  12.         doctors += 1
  13.  
  14.     if patients > doctors:
  15.         untreated_sum += (patients - doctors)
  16.         patients = doctors
  17.  
  18.     treated_sum += patients
  19.  
  20. print(f"Treated patients: {treated_sum}.")
  21. print(f"Untreated patients: {untreated_sum}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement