#C2876. Minimum Total Delivery Time
Minimum Total Delivery Time
Minimum Total Delivery Time
You are given a set of vehicles and packages. Each vehicle has an associated capacity and each package has a delivery time. The goal of this problem is to determine the minimum total delivery time needed to deliver all packages.
Although information about vehicle capacities is provided, the solution simplifies the problem by considering that the total delivery time is the sum of individual package delivery times. In other words, if the delivery times for the packages are \(t_1, t_2, \dots, t_P\), then the minimum total delivery time is given by:
[ S = \sum_{i=1}^{P} t_i ]
You will be given several test cases. For each test case, compute the sum of the delivery times of the packages and output the result on a separate line.
inputFormat
The input consists of multiple test cases. Each test case is described as follows:
- The first line contains two integers, \(V\) and \(P\), where \(V\) is the number of vehicles and \(P\) is the number of packages.
- The second line contains \(V\) integers representing the capacities of the vehicles (note that capacities are provided for information only and do not affect the computation).
- The third line contains \(P\) integers representing the delivery times of each package.
The input is terminated by a line containing 0 0
, which should not be processed as a test case.
outputFormat
For each test case, output a single line containing the minimum total delivery time (i.e., the sum of all package delivery times).
## sample2 5
3 2
1 2 3 4 5
0 0
15
</p>