1014 .等待在线(30 )时间限制400毫秒
内存限制65536 kB
代码长度限制16000 B
问题判定程序Standard作者CHEN,yesupposeabankhasnwindowsopenforservice.thereisayellowlineinfrontofthewindowswhichdevidesthewaitingarrare
thespaceinsidetheyellowlineinfrontofeachwindowisenoughtocontainalinewithmcustomers.hencewhenallthenlinesarefull,althecusttous stonewillhavetowaitinalinebehindtheyellowline.eachcustomerwillchoosetheshortestlinetowaitinwhencrossingtheyellowline.ifthe ameLength, thecustomerwillalwayschoosethewindowwiththesmallestnumber.customer [ I ] will taket [ I ] minutestohavehis/hertransactionprocessed.thefirstncustomersareassumedtobeservedat 8336000 am.nowgiventheprocessingtimeofeachcustomer,youarerered
For example,supposethatabankhas2windowsandeachwindowmayhave 2客户swaitinginsidetheyellowline.there are 5客户swaitingwitte 4and3minutes,respectively.at 08336000 in the morning,customer1isservedatwindow1while customer2isservedatwindow2. customer3window
At 08:01, customer1isdoneandcustomer5entersthelineinfrontofwindow1sincethatlineseemsshorternow.customer2willleaveat 0833333331 customer4aater 4
输入输出
n-top:0px; margin-bottom:1.5 t-family:inherit; vertical-align:baseline"> Each input file contains one test case. Each case starts with a line containing 4 positive integers: N (<=20, number of windows), M (<=10, the maximum capacity of each line inside the yellow line), K (<=1000, number of customers), and Q (<=1000, number of customer queries).The next line contains K positive integers, which are the processing time of the K customers.
The last line contains Q positive integers, which represent the customers who are asking about the time they can have their transactions done. The customers are numbered from 1 to K.
Output
For each of the Q customers, print in one line the time at which his/her transaction is finished, in the format HH:MM where HH is in [08, 17] and MM is in [00, 59]. Note that since the bank is closed everyday after 17:00, for those customers who cannot be served before 17:00, you must output "Sorry" instead.
Sample Input 2 2 7 51 2 6 4 3 534 23 4 5 6 7 Sample Output 08:0708:0608:1017:00Sorry 原题链接:https://www.patest.cn/contests/pat-a-practise/1014