|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|5 초||512 MB||2||2||2||100.000%|
Seeking to cash in on the lucrative private education business, EduCorp recently established the prestigious ”Bootcamp Academy of Economics” and, counter to their early projections, is growing rapidly.
So rapidly, in fact, that the student body is already overflowing the small (but prestigious) campus building and now needs to be contained somewhere else while more new (and prestigious) buildings are built.
Each department will sell off its original space and then move into its own new rented building. As departments are deeply territorial, buildings must not be shared. Because this is an economics academy, the capacities and rents of each of all the local available buildings were easy to find by disguising the task as homework.
However, it still remains to choose which buildings to rent so as to minimise total budget. This is where you can help.
If it is not possible to rent enough buildings for all the departments, output impossible.
Otherwise, output n unique, space-separated integers v1. . . vn, where the i-th number is the building to be rented by the i-th department so as to minimise the total spend on rent. If there are multiple equally good answers, you may print any.
2 5 40 200 1000 199 201 10 50 600 300 400 200 800
3 5 10 20 30 30 25 20 15 10 30 25 20 15 10
5 3 1
1 1 20 10 1