#P3399. Number Spiral

Number Spiral

当前没有测试数据。

Description

A number spiral is an infinite grid whose upper-left square has number 1. Here are the first five layers of the spiral:

Your task is to find out the number in row y and column x.

Input Format

The first input line contains an integer t: the number of tests.

After this, there are t lines, each containing integers y and x.

Output Format

For each test, print the number in row y and column x.
3
2 3
1 1
4 2
8
1
15

Hint

<li> 1t105 </li> <li> 1y,x109 </li>

Source

CSES