723A. The New Year: Meeting Friends
implementation, math, sorting, 800, https://codeforces.com/problemset/problem/723/A
There are three friend living on the straight line Ox in Lineland. The first friend lives at the point
It's guaranteed that the optimal answer is always integer.
Input
The first line of the input contains three distinct integers
Output
Print one integer — the minimum total distance the friends need to travel in order to meet together.
Examples
input
7 1 4output
6input
30 20 10output
20Note
In the first sample, friends should meet at the point 4. Thus, the first friend has to travel the distance of 3 (from the point 7 to the point 4), the second friend also has to travel the distance of 3 (from the point 1 to the point 4), while the third friend should not go anywhere because he lives at the point 4.
x = list(map(int, input().split()))
x.sort()
print(x[-1] - x[0])