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?
InputThe input contains two integers $$$a$$$ and $$$b$$$ ($$$1 \le b \le a \le 10^{6}$$$) — the sides of the square and the brush, correspondingly.
OutputOutput 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.
ExamplesInput4 2Output
6Input
4 3Output
3Input
9 3Output
24Input
1000000 1Output
999999999999