308032: CF1455B. Jumps
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Jumps
题意翻译
你当前站在数轴的原点 $0$ 处,你要移动到数轴上的一个正整数点 $x$ 处。 假如你当前的位置是 $y$ ,正在进行第 $k$ 次操作,你可以做出以下两种移动: - 移动到位置 $y +k$ - 移动到位置 $y-1$ 试求移动到点 $x$ 的最小步数。题目描述
You are standing on the $ \mathit{OX} $ -axis at point $ 0 $ and you want to move to an integer point $ x > 0 $ . You can make several jumps. Suppose you're currently at point $ y $ ( $ y $ may be negative) and jump for the $ k $ -th time. You can: - either jump to the point $ y + k $ - or jump to the point $ y - 1 $ . What is the minimum number of jumps you need to reach the point $ x $ ?输入输出格式
输入格式
The first line contains a single integer $ t $ ( $ 1 \le t \le 1000 $ ) — the number of test cases. The first and only line of each test case contains the single integer $ x $ ( $ 1 \le x \le 10^6 $ ) — the destination point.
输出格式
For each test case, print the single integer — the minimum number of jumps to reach $ x $ . It can be proved that we can reach any integer point $ x $ .
输入输出样例
输入样例 #1
5
1
2
3
4
5
输出样例 #1
1
3
2
3
4