Advertisement
Tsenkov

Hospital_for_loop

Aug 11th, 2022
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. current_doctors = 7
  2. days_to_count = int(input())
  3. day_counter = 0
  4. treated_pations_total = 0
  5. untreated_pations_total = 0
  6. for days in range(days_to_count):
  7.     visitors = int(input())
  8.     day_counter += 1
  9.     if day_counter == 3 and untreated_pations_total > treated_pations_total:
  10.         current_doctors += 1
  11.         day_counter = 0
  12.     if visitors > current_doctors:
  13.         dayly_treated_pations = current_doctors
  14.     else:
  15.         dayly_treated_pations = visitors
  16.     dayly_untreated_pations = visitors - dayly_treated_pations
  17.     treated_pations_total += dayly_treated_pations
  18.     untreated_pations_total += dayly_untreated_pations
  19.  
  20. print(f"Treated patients: {treated_pations_total}.")
  21. print(f"Untreated patients: {untreated_pations_total}.")
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement