Innome

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

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 kk open windows and the ii-th open tab in the window uses ii megabytes of memory. Michael knows that his new laptop has mm megabytes of memory. Please help Michael to calculate the maximum number of tabs he can open.

입력

The first line contains single integer tt, the number of tests. The next tt lines contains description of the tests one per line. Each test is represented by two integers mm and kk,  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.