#0000F5

z-pins

Little Z is keen to win in the upcoming round of programming competitions. Since his class has a lot good programmers, professor Dule has lot of troubles putting all their (competition) results on the big rounded billboard in the school hall.


The billboard has the perimeter so that it can fit exactly K square papers with competition results (with small overlap as professor Dule needs to stick more then one paper with one pin). Billboard is high enough to place all N square papers of the competition results. Dule always has troubles with using to much pins, so he wants you to help him to find optimal number of pins needed to put all the papers on the round billboard. All four corner of every list of paper must have exactly one pin (one pin can handle 1, 2, 3 or 4 papers).


InputIn first line of standard input are integers N and K, separated with space character. 0<=N<2<sup>31</sup> representing the number of competitions (one competition results fit on exactly one paper) and 1<=K<=1 000 000 is number of papers which can be fit on the billboard's perimeter (to close one circle).

OutputTo the first line of standard output you need to write optimal (minimal) number of pins, professor Dule needs in order to put all papers on the billboard.

Input:
6 10
Output:
12
Explanation: To put six papers on this billboard, professor need 12 pins, if he group them in 2 rows and 3 columns.

Input:
9 3
Output:
12
Explanation: To put the nine papers on billboard, professor again need 12 pins, but this time he must group them in 3 rows and 3 columns. He will close circle around the billboard to spare some pins.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.