Fast Food Restaurant What a nice holiday! After travelling to a small beautiful town, Tom plans to get something to eat, finally he finds a small fast food restaurant with a long queue for ordering. He wonders how long he has to wait before ordering his food. Giving you N customers, for each customer you will be given the arrival time A, the service time O needed for making order and the maximum number L of the people representing that if there are more than L people ahead of him (when he/she arrives) in the queue, the customer will give up. Input The input contains multiple test cases. For each test case, the first line contains a number N indicating the number of customers. Each of the following N lines contains three numbers, Ai , Oi and Li corresponding to the i-th customer. It is guaranteed that the sequence of arrival times is non-decreasing (if two customers have the same arrival time, the customer who is earlier in the input is considered to have arrived ea
【无标题】
最新推荐文章于 2025-04-15 10:48:14 发布