[mecse@localhost mecse]$.\a.out AAAAABCAABCAB OUTPUT:2 Agent: putting paper matches Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No! Smoker 3: Getting paper matches - Yes! Smoker 3: I got what I needed! Smoker 3: Rolling. Smoker 3: Smoking. Smoker 3: Done smoking. Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No!
Agent: putting paper matches
Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No! Smoker 3: Getting paper matches - Yes! Smoker 3: I got what I needed! Smoker 3: Rolling. Smoker 3: Smoking. Smoker 3: Done smoking. Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No!
Agent: putting paper matches
Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No! Smoker 3: Getting paper matches - Yes! Smoker 3: I got what I needed! Smoker 3: Rolling. Smoker 3: Smoking. Smoker 3: Done smoking. Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No!
Agent: putting paper matches
Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No! Smoker 3: Getting paper matches - Yes! Smoker 3: I got what I needed! Smoker 3: Rolling. Smoker 3: Smoking. Smoker 3: Done smoking. Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - No! Agent: putting tobacco paper Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - Yes! Smoker 2: I got what I needed! Smoker 2: Rolling. Smoker 3: Getting paper matches - No! Smoker 2: Smoking. Smoker 2: Done smoking. Smoker 2: Getting tobacco paper - No!
Agent: putting tobacco paper
Smoker 1: Getting tobacco matches - No! Smoker 2: Getting tobacco paper - Yes! Smoker 2: I got what I needed! Smoker 2: Rolling. Smoker 3: Getting paper matches - No! Smoker 2: Smoking. OUTPUT:3 This is a barber shop with 5 chairs for waiting. Here is 7 customers want to cut hair. First,the barber is sleeping for there is no customer. customer-2 enter shop. There are 1 chairs occupied. customer-2 is barbering. There are 0 chairs occupied. customer-0 enter shop. There are 1 chairs occupied. customer-1 enter shop. There are 2 chairs occupied. customer-2 is done barbering. There are 2 chairs occupied. customer-0 is barbering. There are 1 chairs occupied. customer-3 enter shop. There are 2 chairs occupied. customer-4 enter shop. There are 3 chairs occupied. customer-5 enter shop. There are 4 chairs occupied. customer-0 is done barbering. There are 4 chairs occupied. customer-1 is barbering. There are 3 chairs occupied. customer-6 enter shop. There are 4 chairs occupied. customer-1 is done barbering. There are 4 chairs occupied. customer-3 is barbering. There are 3 chairs occupied. customer-3 is done barbering. There are 3 chairs occupied. customer-4 is barbering. There are 2 chairs occupied. customer-4 is done barbering. There are 2 chairs occupied. customer-5 is barbering. There are 1 chairs occupied. customer-5 is done barbering. customer-6 is barbering. There are 0 chairs occupied. There are 0 chairs occupied. customer-6 is done barbering. The barber begin to sleep . There are 0 chairs occupied. OUTPUT:5 Press:-