2021 年东华大学金马程序设计联赛

A. Smart AEMShana!
PDF 题面可用
你可以在这里下载。

单点时限: 2.0 sec

内存限制: 512 MB

AEMShana isn’t just charming, he is also very smart.

While some of us were learning the addition table, AEMShana had fun in his own manner.
AEMShana painted an $m\times m$ addition table, where the element on the intersection of the $i$-th row and $j$-th column equals $i+j$ (the rows and columns of the table are numbered starting from $1$).

Then he was asked: what number in the table is the $k$-th least number? AEMShana always answered correctly and immediately. Can you repeat his success?

Consider the given addition table. If you write out all $m\times m$ numbers from the table in the decreasing order, then the $k$-th number you write out is called the $k$-th leaest number.

Note

A $3\times 3$ addition table looks like this:

2 3 4
3 4 5
4 5 6

输入格式

There are multiple test cases(not more than $1000$) in this problem.

In each test case contains integers $m$ and $k$.

$(1\leq m\leq 10^9,1\leq k\leq m\times m)$

输出格式

Print the $k$-th least number in a $m\times m$ addition table.

样例

Input
3 4
114514 1919810
Output
4
1960