In a square area of size n×n, cells are numbered sequentially from 0 to (n2−1) from the top row to the bottom, from left to right in each row.
Nyasyr stands in the cell with number k in this area and wants to find the sum of the numbers of all neighboring cells. Help Nyasyr with this task.
Note that each cell can have no more than 4 neighbors directly above, below, to the left, and to the right.
Below is an example with n=4 and k=11.
Here Nyasyr stands on the cell with number 11, and neighboring cells are marked with circles. In this case, there is no neighbor on the right.
Two integers n (1≤n≤106) and k (0≤k≤n2).
Print the sum of the numbers of all neighboring cells of the given cell.