Company: Apple_1sep
Difficulty: medium
Optimize Pizza Delivery Routes Problem Description Mario's Pizza Palace has received N pizza orders for delivery, lined up in the order they were received. The i -th order takes A[i] minutes to deliver (including travel time). Mario has B delivery drivers available for the evening shift and must assign the orders to them under these rules: Route Efficiency : Each driver's orders must be a contiguous block of the queue. A driver cannot skip an order in the middle - if a driver takes order 1 and order 3, they must also take order 2. Everyone Works : Each of the B drivers must be assigned at least one delivery. No Order Splitting : Each order goes to exactly one driver. In other words, the queue of N orders is cut into exactly B contiguous, non-empty groups, one per driver. Mario wants to distribute the orders so that the driver with the largest total delivery time has that time as small as possible. Find this minimum possible maximum delivery time. If no valid assignment exists (there ar