[Solution] 2-3 Moves Codeforces Solution
You are standing at the point on a coordinate line. Your goal is to reach the point . In one minute, you can move by or by to the left or to the right (i. e., if your current coordinate is , it can become , , or ). Note that the new coordinate can become negative.
Your task is to find the minimum number of minutes required to get from the point to the point .
occupied
You have to answer independent test cases.
The first line of the input contains one integer () — the number of test cases. Then lines describing the test cases follow.
The -th of these lines contains one integer () — the goal of the -th test case.
For each test case, print one integer — the minimum number of minutes required to get from the point to the point for the corresponding test case.
No comments:
Post a Comment