PROGRAMMING:Simple simulation of single queue queuing
A simple program is used to simulate a single queue and multi window queuing mode: < br > the results show that the proposed method is feasible
Suppose a bank has a fixed waiting area which can hold n customers. If customers want to enter the bank, they can enter if the waiting area is free, otherwise they are refused to enter< br>
Whenever a bank teller calls, the first customer in the waiting area leaves the waiting area and goes to the counter for business. If there is no one in the waiting area, the call will be invalid.
###Input format:
In the first line, enter a positive integer 'n' no more than 20, which indicates the number of people that can be accommodated in the bank waiting area, < br > and
Next, a number of lines are used to represent the "customer wants to enter the bank" or "calling" events that occur in chronological order. The formats are: < br > respectively
*"Customer wants to enter the bank" is indicated by "in < ID >", where '< ID > "is the customer number, which is a positive integer no more than 100000< br>
*"Calling" means "calling"< br>
The last line is a '#' symbol, indicating the end of input< br>
be careful:
1. The title input ensures that the number of each customer is unique, that is, there will be no case that the number of customers who want to enter the bank is the same as that of customers who are already in the waiting area.
1. Ensure that the latter event must occur after the previous event, that is, there is no need to consider the "synchronization" between events.
###Output format:
For each input event, output the result of the event in the same order in one line. The formats are as follows:
*If the customer wants to enter the bank, output '< ID > joined. Total: < T >' where '< ID >' is the number of the customer and '< T >' is the number of the waiting area after the customer enters
*If the customer wants to enter the bank and is refused because the waiting area is full, output '< ID > rejected.'Where' < ID > 'is the customer's number
*If a customer goes to the counter, output '< ID > called. Total: < T >' where '< ID >' is the number of the customer and '< T >' is the number of the waiting area after the customer goes to the counter
*If there is no one in the waiting area, no one will be output`
###Input example:
```in
three
In 101
In 102
In 103
In 104
Calling
In 105
Calling
Calling
Calling
Calling
#
```
###Output example:
```out
101 joined. T otal:1
102 joined. T otal:2
103 joined. T otal:3
104 rejected.
101 called. T otal:2
105 joined. T otal:3
102 called. T otal:2
103 called. T otal:1
105 called. T otal:0
No one!
```
answer:If there is no answer, please comment
Suppose a bank has a fixed waiting area which can hold n customers. If customers want to enter the bank, they can enter if the waiting area is free, otherwise they are refused to enter< br>
Whenever a bank teller calls, the first customer in the waiting area leaves the waiting area and goes to the counter for business. If there is no one in the waiting area, the call will be invalid.
###Input format:
In the first line, enter a positive integer 'n' no more than 20, which indicates the number of people that can be accommodated in the bank waiting area, < br > and
Next, a number of lines are used to represent the "customer wants to enter the bank" or "calling" events that occur in chronological order. The formats are: < br > respectively
*"Customer wants to enter the bank" is indicated by "in < ID >", where '< ID > "is the customer number, which is a positive integer no more than 100000< br>
*"Calling" means "calling"< br>
The last line is a '#' symbol, indicating the end of input< br>
be careful:
1. The title input ensures that the number of each customer is unique, that is, there will be no case that the number of customers who want to enter the bank is the same as that of customers who are already in the waiting area.
1. Ensure that the latter event must occur after the previous event, that is, there is no need to consider the "synchronization" between events.
###Output format:
For each input event, output the result of the event in the same order in one line. The formats are as follows:
*If the customer wants to enter the bank, output '< ID > joined. Total: < T >' where '< ID >' is the number of the customer and '< T >' is the number of the waiting area after the customer enters
*If the customer wants to enter the bank and is refused because the waiting area is full, output '< ID > rejected.'Where' < ID > 'is the customer's number
*If a customer goes to the counter, output '< ID > called. Total: < T >' where '< ID >' is the number of the customer and '< T >' is the number of the waiting area after the customer goes to the counter
*If there is no one in the waiting area, no one will be output`
###Input example:
```in
three
In 101
In 102
In 103
In 104
Calling
In 105
Calling
Calling
Calling
Calling
#
```
###Output example:
```out
101 joined. T otal:1
102 joined. T otal:2
103 joined. T otal:3
104 rejected.
101 called. T otal:2
105 joined. T otal:3
102 called. T otal:2
103 called. T otal:1
105 called. T otal:0
No one!
```
answer:If there is no answer, please comment