1180: Elevator
Memory Limit:256 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:45
Solved:25
Description
不允许普通用户打印题目,请教师登录后使用。如有疑问请联系管理员!
Input
The first line contains one integer T (1≤T≤10^4 ), indicating the number of test cases.
For each test case, only one line contains two integers n,m (1≤m≤n≤10^4 ), indicating the number of people in the elevator and the number of unique selected floors, respectively.
Output
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.
Sample Input Copy
1
6 3
Sample Output Copy
4