Young software developer Michael succeeded on Innopolis Open and was awarded by Innobook laptop with a pre-installed "Innome" web browser. This strange web browser can support at most k open windows and the i-th open tab in the window uses i megabytes of memory. Michael knows that his new laptop has m megabytes of memory. Please help Michael to calculate the maximum number of tabs he can open.
The first line contains single integer t, the number of tests. The next t lines contains description of the tests one per line. Each test is represented by two integers m and k, the size of Innobook memory and the maximum possible number of windows.
For each test output a single integer on a separate line, the maximum number of tabs that Michael can open.