#C8682. Minimize Delivery Time
Minimize Delivery Time
Minimize Delivery Time
You are given information about several delivery hubs. Each hub has a number of packages, and for each package, two values are provided: the distance di and the delivery time ti. Although the distance is given, the goal is to minimize the total delivery time by simply taking into account the delivery times. The optimized total delivery time for a hub is computed using the formula:
\( T = 2 \times \sum_{i=1}^{K} t_i \)
Here, \(K\) is the number of packages in the hub and \(t_i\) is the delivery time for the i-th package. You need to process all hubs and compute the minimized total delivery time for each one.
inputFormat
The input is read from standard input. The first line contains an integer \(H\) which represents the number of hubs. For each hub, the following input is provided:
- The first line contains an integer \(K\), the number of packages at that hub.
- Then \(K\) lines follow, each containing two space-separated integers \(d_i\) and \(t_i\) representing the distance and delivery time for the package.
Note: Even though the distance value is provided, the solution only uses the delivery times.
outputFormat
Print the minimized total delivery time for each hub on one line, separated by a single space. For example, if there are three hubs with minimized times \(T_1\), \(T_2\), and \(T_3\), the output should be:
T1 T2 T3
2
3
10 5
15 10
20 15
2
5 3
10 7
60 20