tod36

01. Softuni reception mid exam 05 07 2020

Jul 5th, 2020
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. empl_1 = int(input())
  2. empl_2 = int(input())
  3. empl_3 = int(input())
  4. all_student = int(input())
  5. students_to_answer = all_student
  6. student_per_hour = empl_1+empl_2+empl_3
  7. time_for_answers = 0
  8.  
  9. while students_to_answer > 0:
  10.     for i in range(1, 4):
  11.         students_to_answer -= student_per_hour
  12.         time_for_answers += 1
  13.         if students_to_answer <= 0:
  14.             break
  15.         else:
  16.             i += 1
  17.     if students_to_answer > 0:
  18.         time_for_answers += 1
  19.         i = 1
  20.  
  21. print(f'Time needed: {time_for_answers}h.')
Advertisement
Add Comment
Please, Sign In to add comment