#ABC103A. Task Scheduling Problem

Task Scheduling Problem

题目描述

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

First, you can complete any one task at cost 00.

Then, just after completing the ii-th task, you can complete the jj-th task at cost AjAi|A_j - A_i|.

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

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

您有三项任务,都需要完成。

首先,您可以花费 00 完成任何一项任务。

然后,在完成 ii /-三项任务后,你可以完成 jj /三项任务,费用为 AjAi|A_j - A_i|

这里, x|x| 表示 xx 的绝对值。

求完成所有任务所需的最小总成本。

输入格式

$A_1$ $A_2$ $A_3$

输出格式

打印完成所有任务所需的最低总成本。

样例 #1

样例输入 #1

1 6 3

样例输出 #1

5

样例 #2

样例输入 #2

11 5 5

样例输出 #2

6

样例 #3

样例输入 #3

100 100 100

样例输出 #3

0

说明

数据规模与约定

  • 所有输入值均为整数。
  • 1A1,A2,A31001 \leq A_1, A_2, A_3 \leq 100

样例 11 解释

当任务按以下顺序完成时,总成本将为 55 ,即最低成本:

  • 完成第一项任务的成本为 00
  • 完成第三项任务,成本为 22
  • 完成第二项任务,费用为 33