Recently the auction house hasintroduced a new type of auction, the lowest price auction. In this new system,people compete for the lowest bid price, as opposed to what they did in the past.What an amazing thing! Now you could buy cool stuff with one penny. Your taskis to write the software to automate this auction system.
First the auctioneer puts an upper limiton bid price for each item. Only positive price less than or equal to thisprice limit is a valid bid. For example, if the price limit is 100, then 1 to100, inclusive, are all valid bid prices. Bidder can not put more than one bidfor the same price on a same item. However they can put many bids on a sameitem, as long as the prices are different.
After all bids are set, the auctioneerchooses the winner according to the following rules: <o:p></o:p>
(1). If any valid price comes from onlyone bidder, the price is a "unique bid". If there are unique bids,then the unique bid with the lowest price wins. This price is the winning priceand the only bidder is the winning bidder. <o:p></o:p>
(2). If there are no unique bids, thenthe price with fewest bids is the winning bid. If there are more than one pricewhich has the same lowest bid count, choose the lowest one. This price is thewinning price. The bidder who puts this bid first is the winning bidder.
Giventhe price limit and all the bids that happen in order, you will determine thewinning bidder and the winning price. <o:p></o:p>