Pro.ID21327 TitleSteps Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21327 AC22 Submit53 Ratio41.51% 时间&空间限制描述One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step. What is the minimum number of steps in order to get from x to y? The length of the first and the last step must be 1. 输入Input consists of a line containing n, the number of test cases. 输出Description One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step. What is the minimum number of steps in order to get from x to y? The length of the first and the last step must be 1. Input Input consists of a line containing n, the number of test cases. Output For each test case, a line follows with two integers: 0 ≤ x ≤ y < 231. For each test case, print a line giving the minimum number of steps to get from x to y. Sample Input 3 Sample Output 3 Source 样例输入3 样例输出3 作者 |