A hospital has three categories of doctors (A, B, C) every new patient direct towards category A doctor. for category A only 5 patient can be in the queue.
If category A has no space the new patient will direct towards category B doctor. 10 patients can in the queue for category B doctor
If category A and B have no space for new patient .new patient will direct towards category C doctor. 10 patients can be in the queue for category C doctor.
For each new patient, it will check in which category it will place new patients. Priority will be in order A, B, C
If there is no space in any category it will display a message no space available.
Answer to : Question 144072