#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 */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, j = 0, t;
  scanf("%d", &t);
  while (j < t) {
    scanf("%d", &n);
    int noe = 0, a = 1, b = 2, sum = a + b;
    while (noe < n) {
      if (noe == 0) {
        printf("%d ", a);
        noe++;
      } else if (noe == 1) {
        printf("%d ", b);
        noe++;
      } else {
        printf("%d ", sum + 1);
        sum += sum;
        noe++;
      }
      if (noe == n)
        break;
    }
    j++;
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123b <main+0x11b>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121f <main+0xff>
cmpl   $0x0,-0x18(%rbp)
jne    11b5 <main+0x95>
mov    -0x1c(%rbp),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1209 <main+0xe9>
cmpl   $0x1,-0x18(%rbp)
jne    11de <main+0xbe>
mov    -0x20(%rbp),%esi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1204 <main+0xe4>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1209 <main+0xe9>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    121a <main+0xfa>
jmp    121f <main+0xff>
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11ef <main+0xbf>
lea    0xea5(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe9c(%rip),%r13
xor    %r12d,%r12d
jmp    1184 <main+0x54>
nopl   0x0(%rax)
add    $0x1,%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    (%rsp),%r12d
jge    11ef <main+0xbf>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    $0x3,%ebp
mov    0x4(%rsp),%eax
xor    %ebx,%ebx
jmp    11bc <main+0x8c>
nopl   0x0(%rax)
mov    $0x1,%ebx
mov    %r13,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
je     1170 <main+0x40>
cmp    %eax,%ebx
jge    1170 <main+0x40>
cmp    $0x1,%ebx
je     11e0 <main+0xb0>
test   %ebx,%ebx
je     11a0 <main+0x70>
lea    0x1(%rbp),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebp,%ebp
add    $0x1,%ebx
jmp    11b4 <main+0x84>
nopl   (%rax)
mov    $0x2,%ebx
mov    %r13,%rdi
mov    $0x2,%esi
jmp    11ad <main+0x7d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
br label %11
11: ; preds = %56, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %60
15: ; preds = %11
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %6
store i32 1, i32* %7
store i32 2, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
store i32 %19, i32* %9
br label %20
20: ; preds = %55, %15
%21 = load i32, i32* %6
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %56
24: ; preds = %20
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i32, i32* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %50
32: ; preds = %24
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* %8
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %49
40: ; preds = %32
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %9
%45 = load i32, i32* %9
%46 = add nsw i32 %45, %44
store i32 %46, i32* %9
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %49
49: ; preds = %40, %35
br label %50
50: ; preds = %49, %27
%51 = load i32, i32* %6
%52 = load i32, i32* %2
%53 = icmp eq i32 %51, %52
br i1 %53, label %54, label %55
54: ; preds = %50
br label %56
55: ; preds = %50
br label %20
56: ; preds = %54, %20
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %11
60: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %37
8: ; preds = %0, %32
%9 = phi i32 [ %33, %32 ], [ 0, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
br label %12
12: ; preds = %27, %8
%13 = phi i32 [ %11, %8 ], [ %30, %27 ]
%14 = phi i32 [ 0, %8 ], [ %28, %27 ]
%15 = phi i32 [ 3, %8 ], [ %29, %27 ]
%16 = icmp slt i32 %14, %13
br i1 %16, label %17, label %32
17: ; preds = %12
switch i32 %14, label %22 [
i32 0, label %18
i32 1, label %20
]
18: ; preds = %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %27
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
br label %27
22: ; preds = %17
%23 = add nsw i32 %15, 1
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = shl nsw i32 %15, 1
%26 = add nsw i32 %14, 1
br label %27
27: ; preds = %20, %22, %18
%28 = phi i32 [ 1, %18 ], [ 2, %20 ], [ %26, %22 ]
%29 = phi i32 [ %15, %18 ], [ %15, %20 ], [ %25, %22 ]
%30 = load i32, i32* %1
%31 = icmp eq i32 %28, %30
br i1 %31, label %32, label %12
32: ; preds = %27, %12
%33 = add nuw nsw i32 %9, 1
%34 = call i32 @putchar(i32 10)
%35 = load i32, i32* %2
%36 = icmp slt i32 %33, %35
br i1 %36, label %8, label %37
37: ; preds = %32, %0
ret i32 0
}