Imagine yourself in an elevator along with $$$n-1$$$ other people, making it a total of $$$n$$$ people. Each person has chosen a floor they wish to alight at. When the elevator stops at any given floor, all those who have selected that floor will exit the elevator.
In this scenario, $$$m$$$ unique floors have been selected. Your task is to determine the maximum possible number of people, including yourself, who could leave the elevator on the floor you have chosen.
The first line contains one integer $$$T$$$ ($$$1\le T\le 10^4$$$), indicating the number of test cases.
For each test case, only one line contains two integers $$$n,m$$$ ($$$1\le m\le n\le 10^4$$$), indicating the number of people in the elevator and the number of unique selected floors, respectively.
For each test case, output one integer in a single line, indicating the maximum number of people who could leave the elevator at the floor you have chosen.
16 3
4
| Name |
|---|


