ZOJ Problem Set - 3635
Cinema in Akiba (CIA) is a small but very popular cinema in Akihabara. Every night the cinema is full of people. The layout of CIA is very interesting, as there is only one row so that every audience can enjoy the wonderful movies without any annoyance by other audiences sitting in front of him/her.
The ticket for CIA is strange, too. There are n seats in CIA and they are numbered from 1 to n in order. Apparently, n tickets will be sold everyday. When buying a ticket, if there are k tickets left, your ticket number will be an integer i (1 ≤ i ≤ k), and you should choose the ith empty seat (not occupied by others) and sit down for the film.
On November, 11th, n geeks go to CIA to celebrate their anual festival. The ticket number of the ith geek is ai. Can you help them find out their seat numbers?
The input contains multiple test cases. Process to end of file.
For each test case, print m integers in a line, seperated by one space. The ith integer is the seat number of the qith geek.
3 1 1 1 3 1 2 3 5 2 3 3 2 1 5 2 3 4 5 1
1 2 3 4 5 3 1 2
Author: LI, Dinghua
Contest: ZOJ Monthly, August 2012