You are opening a new auction business. To keep out buyers who win an auction and then back out, every bidder must deposit funds with you before they are allowed to bid on any item. The moment a bidder wins an auction, the amount they bid is deducted from their account balance in that very second.
Write a program that simulates a single day of auctions. Several items are auctioned off, and each item has a reserve (minimum) price that must be met. Each bidder has a deposited balance, and every winning bid is paid out of that balance. Your program tracks every auction during the day and reports the result of each one.
Guarantees
Winning rule
An auction is won by the highest bid that satisfies all of the following:
Because a winning bid is deducted the instant its auction ends, process the auctions in order of their end times: a bidder who wins an earlier auction may no longer have enough balance to win a later one.
The input has three parts: the items available for bidding, the registered bidders, and the bids placed during the day.
Items
i.i lines, one per item: item_number minimum_price end_time
item_number is a non-negative integer.minimum_price is given to the penny (0.01).end_time is in 24-hour HH:MM:SS format, where HH is 00–23, MM is 00–59, and SS is 00–59.Bidders
j.j lines, one per bidder: bidder_number account_balance
bidder_number is a non-negative integer.account_balance is given to the penny (0.01).Bids
k.k lines, one per bid: item_number bidder_number bid_amount bid_time
Print one line for each item, in order of the item's auction end time.
For an item that has a winning bid, print:
Item <item_number> Bidder <bidder_number> Price <winning_bid>
For an item with no winning bid, print:
Item <item_number> Reserve not met.
Amounts are printed to the penny (for example, 27.00).