406003: GYM102215 I Painting a Square

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Painting a Squaretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

There is a square of size $$$a \times a$$$. In its top left corner there is a square brush of size $$$b \times b$$$. You should use this brush to paint a square (you can assume that the top left corner of size $$$b \times b$$$ is already painted). It is allowed to move a brush only in parallel to the square's sides. What is the minimal distance the center of the brush should pass to make the whole square painted?

Input

The input contains two integers $$$a$$$ and $$$b$$$ ($$$1 \le b \le a \le 10^{6}$$$) — the sides of the square and the brush, correspondingly.

Output

Output a single integer — the minimal distance that should be passed by the center of the brush. It is guaranteed that the answer is an integer.

ExamplesInput
4 2
Output
6
Input
4 3
Output
3
Input
9 3
Output
24
Input
1000000 1
Output
999999999999

加入题单

上一题 下一题 算法标签: