atcoder#AGC008A. [AGC008A] Simple Calculator

[AGC008A] Simple Calculator

Score : 300300 points

Problem Statement

Snuke has a calculator. It has a display and two buttons.

Initially, the display shows an integer xx. Snuke wants to change this value into another integer yy, by pressing the following two buttons some number of times in arbitrary order:

  • Button A: When pressed, the value on the display is incremented by 11.
  • Button B: When pressed, the sign of the value on the display is reversed.

Find the minimum number of times Snuke needs to press the buttons to achieve his objective. It can be shown that the objective is always achievable regardless of the values of the integers xx and yy.

Constraints

  • xx and yy are integers.
  • x,y109|x|, |y| \leq 10^9
  • xx and yy are different.

Input

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

xx yy

Output

Print the minimum number of times Snuke needs to press the buttons to achieve his objective.

10 20
10

Press button A ten times.

10 -10
1

Press button B once.

-10 -20
12

Press the buttons as follows:

  • Press button B once.
  • Press button A ten times.
  • Press button B once.