시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 512 MB64221932.203%

문제

Today is the birthday of Farmer Eric’s cow, Emily. Since Emily didn’t manage to get a present last year, Eric wants to give her a square with delicious grass.

Farmer Eric’s farm has a broad field with $n^2$ pillars arranged in $n$ rows and $n$ columns. (The distance between the nearest pillars is $1 \, \mathrm{m}$.)

He started to plan for Emily's birthday present to make Emily happy. In a couple of minutes, he figured out that the square should satisfy the following conditions:

  • have the pillars as its vertices;
  • have an area of at least $a \, \mathrm{m}^2$.

For convenience, you can ignore the height and the thickness of the pillars.

Farmer Eric was thinking about the number of possible birthday presents for Emily but just gave up counting(probably because there was work left to do). Can you count it instead?

입력

The first line contains the number $T$ — the number of test cases.

The single line of each test case contains two integers $n$ and $a$.

출력

For each test case, print the number of possible birthday presents for Emily. If there aren't any, print 0.

제한

  • $T \ge 1$
  • $2 \le n \le 2 \cdot 10^3$
  • $1 \le a \le (n-1)^2+1$
  • The total sum of $n$ over test cases doesn't exceed $2 \cdot 10^3$.
  • All values in input are integers.

예제 입력 1

3
2 1
2 2
3 3

예제 출력 1

1
0
1

In the third test case, the only possible birthday present is below. (The orange square represents Emily’s present.)

출처