There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrival_i, time_i]:
arrival_i is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order.time_i is the time needed to prepare the order of the ith customer.When a customer arrives, they give the chef their order, and the chef starts preparing it once idle. The customer waits until the chef finishes preparing their order. The chef does not prepare food for more than one customer at a time. The chef prepares food for customers in the order they were given in the input.
Return the average waiting time of all customers. Solutions within 10^-5 from the actual answer are considered accepted.
1 <= customers.length <= 10^51 <= arrival_i, time_i <= 10^4arrival_i <= arrival_(i+1)customers = [[1,2],[2,5],[4,3]]5.00000customers = [[5,2],[5,4],[10,3],[20,1]]3.25000