import java.util.Scanner;
public class UVa10276 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int times = input.nextInt();
int towerN = 0, num = 1, temp = 0;
boolean ns = true, find = false;
for (int i = 0; i < times; i++) {
towerN = input.nextInt();
num = 1;
int[] t = new int[towerN];
int z = 0;
while (z < towerN) {
temp = t[z] + num;
find = false;
for (int j = 1; j * j <= temp; j++) {
if (j * j == temp || t[z] == 0) {
t[z] = num;
num++;
z = 0;
find = true;
break;
}
}
if (find != true) {
z++;
}
}
System.out.println(num - 1);
}
}
}