#include <stdio.h>
int find_triangle_perimeter(int base) {
if (base % 2 == 0) {
// If base is even, the other sides can be base/2 and hypotenuse = base/2 + 1
int height = base / 2;
int hypotenuse = height + 1;
return base + height + hypotenuse;
} else {
// If base is odd, the other sides can be (base-1)/2, (base+1)/2, and hypotenuse = (base+1)/2
int height = (base - 1) / 2;
int hypotenuse = (base + 1) / 2;
return base + height + hypotenuse;
}
}
int main() {
int T, B;
scanf("%d", &T);
for (int i = 0; i < T; i++) {
scanf("%d", &B);
int perimeter = find_triangle_perimeter(B);
printf("%d\n", perimeter);
}
return 0;
}