|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||14||9||6||85.714%|
Rupert makes a living as the only real estate agent in a small town in England. He asks for 5% commission for every house that he sells.
Rupert organises one big auction per year. Every family (numbered from 1 to n) must participate in this action, although making or an accepting an offer is optional. Everyone puts in bids for the houses they would like to move to, provided they can sell their current house at the same time.
This is a very transparent process–Rupert can see exactly how much commission he will make if he accepts the right buyers’ offers on behalf of the sellers. He may discard some offers from buyers in order to drive up the overall commission. In fact, he might even decide to discard all of the offers from one family and let them stay in their current home, if it makes more money for him.
Find the maximum commission Rupert can make if he discards offers optimally.
The input consists of:
Output how much Rupert will earn via commissions if he discards offers optimally. Your answer must be accurate to an absolute or relative error of 10−6.
4 5 1 2 3 2 3 9 3 1 5 3 2 11 4 1 6
4 5 1 2 15 2 3 9 3 1 5 3 2 11 4 1 6