#B3686. Delta of Luogu Cities
Delta of Luogu Cities
Delta of Luogu Cities
In the parallel world of Luogu, there exist three cities: A, B, and C, which form the Luogu Delta. There are bidirectional roads connecting every pair of these cities:
- The road between city A and B takes \(x\) minutes.
- The road between city B and C takes \(y\) minutes.
- The road between city C and A takes \(z\) minutes.
Since the congestion on each road is different, the travel times vary. However, the congestion is symmetric on any given road (i.e. the time from A to B is the same as B to A, and so on).
The station master frequently travels between the cities for business, and he needs to know the minimum time to travel between any two cities. For the three pairs, compute:
- Minimum time from A to B, which is \(\min(x, y+z)\).
- Minimum time from B to C, which is \(\min(y, x+z)\).
- Minimum time from A to C, which is \(\min(z, x+y)\).
Help him by computing these minimum travel times.
inputFormat
The input consists of a single line containing three space-separated integers \(x\), \(y\), and \(z\):
- \(x\): the time (in minutes) to travel between city A and city B.
- \(y\): the time (in minutes) to travel between city B and city C.
- \(z\): the time (in minutes) to travel between city C and city A.
outputFormat
Output three integers separated by a space, representing the minimum travel times between the following pairs:
- From city A to B: \(\min(x, y+z)\)
- From city B to C: \(\min(y, x+z)\)
- From city A to C: \(\min(z, x+y)\)
sample
1 3 1
1 2 1