409772: GYM103741 B Contest Preparation
Description
Walk_alone is anxious to prepare for a programming contest, and he has ideas for $$$n$$$ problems now. Preparing a problem from scratch requires two jobs: making and validating. He asked $$$m$$$ people to help him with these two jobs.
All these $$$m$$$ people are skilled at making and validating problems, and each person needs exactly $$$1$$$ hour to do one of these two jobs. A job should be done by only one person without interruption (but making and validating one problem can be done by two different people), and a problem must be made before validated. Now Walk_alone wants to know the minimum hours to prepare for the contest if he arranges everyone's job properly.
InputThe input contains multiple test cases.
The first line of the input contains an integer $$$T\ (1 \leq T \leq 10^5)$$$ indicating the number of test cases.
For each testcase, there will be only one line containing two integers $$$n\ (0 \leq n \leq 10^9)$$$ and $$$m\ (1 \leq m \leq 10^9)$$$, indicating the number of problems and the number of people.
OutputFor each testcase, output a single integer indicating the minimum hours Walk_alone should wait before the contest is well prepared.
ExampleInput3 0 2 2 2 4 3Output
0 2 3