#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ ceil(float);
int pow(int, scalar_t__);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int test_cases, a;
  float cycles;
  scanf("%d", &test_cases);
  while (test_cases--) {
    scanf("%g", &cycles);
    a = pow(2, ceil(cycles / 2) + 1);
    if ((int)cycles % 2) {
      printf("%d\n", a - 2);
    } else {
      printf("%d\n", a - 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11f5 <main+0xb5>
lea    0xe8b(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe6c(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %eax,-0xc(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11de <main+0x9e>
mov    -0xc(%rbp),%esi
sub    $0x2,%esi
lea    0xe36(%rip),%rdi
call   1040 <printf@plt>
jmp    11f0 <main+0xb0>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
jmp    1161 <main+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     11ca <main+0x8a>
lea    0xe9d(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe94(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
mulss  0xe65(%rip),%xmm0
call   1030 <ceil@plt>
lea    0x1(%rax),%rsi
mov    $0x2,%edi
call   1060 <pow@plt>
cvttss2si 0x8(%rsp),%esi
not    %esi
or     $0xfffffffe,%esi
add    %eax,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    1180 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%g\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %29, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = load float, float* %4
%13 = fdiv float %12, 2.000000e+00
%14 = call i64 @ceil(float %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @pow(i32 2, i64 %15)
store i32 %16, i32* %3
%17 = load float, float* %4
%18 = fptosi float %17 to i32
%19 = srem i32 %18, 2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %10
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 2
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %29
25: ; preds = %10
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25, %21
br label %6
30: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%g\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %25, label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %2
%12 = fmul float %11, 5.000000e-01
%13 = call i64 @ceil(float %12)
%14 = add nsw i64 %13, 1
%15 = call i32 @pow(i32 2, i64 %14)
%16 = load float, float* %2
%17 = fptosi float %16 to i32
%18 = and i32 %17, 1
%19 = xor i32 %18, -1
%20 = add nsw i32 %15, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, -1
store i32 %23, i32* %1
%24 = icmp eq i32 %22, 0
br i1 %24, label %25, label %9
25: ; preds = %9, %0
ret i32 0
}