AtCoder Beginner Contest 103
A
Task Scheduling Problem
AtCoder
⌀ 0
原题
←B →
翻译中…

Problem Statement

翻译中…

You have three tasks, all of which need to be completed.

翻译中…

First, you can complete any one task at cost $0$.

翻译中…

Then, just after completing the $i$-th task, you can complete the $j$-th task at cost $|A_j - A_i|$.

翻译中…

Here, $|x|$ denotes the absolute value of $x$.

翻译中…

Find the minimum total cost required to complete all the task.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \leq A_1, A_2, A_3 \leq 100$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

A_1 A_2 A_3

翻译中…

Output

翻译中…

Print the minimum total cost required to complete all the task.

翻译中…

样例

Input #1
1 6 3
Output #1
5
When the tasks are completed in the following order, the total cost will be $5$, which is the minimum: - Complete the first task at cost $0$. - Complete the third task at cost $2$. - Complete the second task at cost $3$.
Input #2
11 5 5
Output #2
6
Input #3
100 100 100
Output #3
0
题目信息
题号
abc103_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。