A. Minimum Black Cells
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given two integers $$$n$$$ and $$$k$$$.

There's an $$$n\times n$$$ grid. At each step, you can move one cell up, down, left, or right, but you cannot move out of bounds. At first, all cells in the grid are white. You need to color some cells black, such that no matter how you move from the top-left corner to the bottom-right corner, you pass through at least $$$k$$$ number of black cells.

Find the minimum number of black cells required to be colored to satisfy the condition above.

Input

The first line contains a single integer $$$t(1 \le t\le 1000)$$$ — the number of test cases.

The only line of each test case contains two space-separated integers $$$n$$$ and $$$k(2 \le n\le 1000,0\le k\le 2\cdot n-1)$$$.

Output

For each test case, output in a new line  — the minimum number of black cells required to be colored to satisfy the condition above.

Example
Input
5
2 0
2 1
6 7
10 19
300 194
Output
0
1
16
100
9506