Contest Duration: - (local time) (100 minutes) Back to Home
B - Hammer /

Time Limit: 2 sec / Memory Limit: 1024 MB

### 制約

• -1000 \leq X,Y,Z \leq 1000
• X,Y,Z は相異なり、いずれも 0 でない
• 入力に含まれる値は全て整数である

### 入力

X Y Z


### 入力例 1

10 -10 1


### 出力例 1

10


### 入力例 2

20 10 -10


### 出力例 2

40


ゴールは壁の向こう側にあります。まずハンマーを拾い、壁を壊すことでゴールに到達することができます。

### 入力例 3

100 1 1000


### 出力例 3

-1


Score : 200 points

### Problem Statement

Takahashi is at the origin of a number line. He wants to reach a goal at coordinate X.

There is a wall at coordinate Y, which Takahashi cannot go beyond at first.
However, after picking up a hammer at coordinate Z, he can destroy that wall and pass through.

Determine whether Takahashi can reach the goal. If he can, find the minimum total distance he needs to travel to do so.

### Constraints

• -1000 \leq X,Y,Z \leq 1000
• X, Y, and Z are distinct, and none of them is 0.
• All values in the input are integers.

### Input

The input is given from Standard Input in the following format:

X Y Z


### Output

If Takahashi can reach the goal, print the minimum total distance he needs to travel to do so. If he cannot, print -1 instead.

### Sample Input 1

10 -10 1


### Sample Output 1

10


Takahashi can go straight to the goal.

### Sample Input 2

20 10 -10


### Sample Output 2

40


The goal is beyond the wall. He can get there by first picking up the hammer and then destroying the wall.

### Sample Input 3

100 1 1000


### Sample Output 3

-1