B. ashon37w likes math
Given n, m, find how many pairs of positive integers (x, y) satisfy the equation set below.
\[\left\{\begin{array}{c}x+y=n\\\lfloor\frac{x}{y}\rfloor+\lceil\frac{y}{x}\rceil=m\\\end{array}\right. \]
\[ {\lfloor x \rfloor}$$means round down $${\lceil x \rceil}$$means round up. <font size=5>**Input**</font> An integer T in the first line indicates that this data point has several sets of data. The next two integers n and m in each line of T are as described in the title. <font size=5>**Output**</font> T lines,a positive integer in each line indicates the answer.\]