// Arup Guha
// 9/7/2013
// Solution to UCF JV Practice Problem A: Diagonal

import java.util.*;

public class a {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// The key to solve this is realizing that the number of diagonals for an n-gon is n(n-3)/2.
		// Set n(n-3)/2 >= N to get the quadratic n^2 - 3n - 2N >= 0 and solve for n. Normally, I'd do
		// binary search here to avoid rounding errors, but the ceiling function worked just fine here.
		for (int loop=0; loop<numCases; loop++) {
			long diags = stdin.nextLong();
			int ans = (int)(Math.ceil((3 + Math.sqrt(9+8*diags))/2));
			System.out.println(ans);
		}
	}
}