Simple Math
You are given some sequence of unlimited number of elements where you have 1 copy of one, 2 copies of two, 3 copies of three...
Your task is to find N-th element of such sequence.
InputThe input consists of T test cases. The number of test cases T is given in the first line of the input file. Each test case begins with a line containing an integer N , 1 <= N <= 2^31 - 1, that represents the position in sequence.
Output
The output should contain the N-th element of the sequence, one per line.
The output should contain the N-th element of the sequence, one per line.
Input:
2
4
7
Output:
3
4
Explanation: The sequence looks like this: 1, 2 , 2 , 3, 3 , 3, 4 , 4, 4, 4,
so the 4 -th element is 3, and the 7-th element is 4.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.