-->
当前位置:首页 > 题库

PROGRAMMING:Simple simulation of bank business queue

Luz5年前 (2021-05-10)题库414
Suppose a bank has two business windows a and B, and the processing speed is different. The processing speed of window a is twice that of window B, that is, when window a processes two customers, window B processes one customer. Given the customer sequence arriving at the bank, please output the customer sequence in the order of business completion. Suppose that the time interval of customers' arrival is not considered, and when different windows process two customers at the same time, window a will give priority to customers' output.
###Input format:
The input is a row of positive integers, where the first number n ($$$Le $$1000) is the total number of customers, followed by the number of n customers. Odd customers need to go to window a for business, even customers need to go to window B. Numbers are separated by spaces.
###Output format:
Output the customer number in the order of business processing. Numbers are separated by spaces, but there should be no extra spaces after the last number.
###Input example:
```in
8 2 1 3 9 4 11 13 15
```
###Output example:
```out
1 3 2 9 11 4 13 15
```






answer:If there is no answer, please comment