#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*/ printArray(int *, int);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, a, b, t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    scanf("%d", &a);
    scanf("%d", &b);
    n = n - 1;
    int arr[n + 1];
    for (int i = 0; i <= n; i++) {
      arr[i] = a * i + b * (n - i);
    }
    quickSort(arr, 0, n);
    printArray(arr, n + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     122e <main+0xfe>
lea    0xe96(%rip),%rdi
mov    %rdi,-0x40(%rbp)
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x40(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x40(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1205 <main+0xd5>
mov    -0x38(%rbp),%rax
mov    -0xc(%rbp),%edx
imul   -0x2c(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%esi
sub    -0x2c(%rbp),%esi
imul   %esi,%ecx
add    %ecx,%edx
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11cb <main+0x9b>
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1040 <quickSort@plt>
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1050 <printArray@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    114f <main+0x1f>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf08(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <scanf@plt>
subl   $0x1,-0x30(%rbp)
jae    1168 <main+0x38>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xee1(%rip),%r13
lea    -0x38(%rbp),%r15
lea    -0x34(%rbp),%r12
jmp    11a1 <main+0x71>
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <quickSort@plt>
mov    -0x2c(%rbp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1050 <printArray@plt>
mov    %r14,%rsp
subl   $0x1,-0x30(%rbp)
jb     1157 <main+0x27>
mov    %r13,%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <scanf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1030 <scanf@plt>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,-0x2c(%rbp)
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x2c(%rbp),%edx
test   %edx,%edx
js     1180 <main+0x50>
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%r8d
lea    0x1(%rdx),%r10
cmp    $0x7,%edx
jae    1210 <main+0xe0>
xor    %esi,%esi
jmp    14c0 <main+0x390>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r10d,%esi
and    $0xfffffff8,%esi
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm3
movd   %edx,%xmm0
pshufd $0x0,%xmm0,%xmm8
movd   %r8d,%xmm1
pshufd $0x0,%xmm1,%xmm10
lea    -0x8(%rsi),%rcx
mov    %rcx,%r9
shr    $0x3,%r9
add    $0x1,%r9
pshufd $0xf5,%xmm3,%xmm4
pshufd $0xf5,%xmm10,%xmm9
test   %rcx,%rcx
je     14f3 <main+0x3c3>
mov    %r9,%rcx
and    $0xfffffffffffffffe,%rcx
xor    %edi,%edi
movdqa 0xd98(%rip),%xmm5
movdqa 0xd9f(%rip),%xmm11
movdqa 0xda6(%rip),%xmm12
movdqa 0xdad(%rip),%xmm13
movdqa 0xdb4(%rip),%xmm14
nopl   0x0(%rax)
movdqa %xmm5,%xmm6
paddd  %xmm11,%xmm6
movdqa %xmm3,%xmm7
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm7
pshufd $0xf5,%xmm5,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm7
movdqa %xmm3,%xmm0
pmuludq %xmm6,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshufd $0xf5,%xmm6,%xmm2
pmuludq %xmm4,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm0
movdqa %xmm8,%xmm2
psubd  %xmm5,%xmm2
movdqa %xmm8,%xmm1
psubd  %xmm6,%xmm1
movdqa %xmm10,%xmm6
pmuludq %xmm2,%xmm6
pshufd $0xe8,%xmm6,%xmm6
pshufd $0xf5,%xmm2,%xmm2
pmuludq %xmm9,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm6
paddd  %xmm7,%xmm6
movdqa %xmm10,%xmm2
pmuludq %xmm1,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pshufd $0xf5,%xmm1,%xmm1
pmuludq %xmm9,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm2
paddd  %xmm0,%xmm2
movdqa %xmm6,(%rbx,%rdi,4)
movdqa %xmm2,0x10(%rbx,%rdi,4)
movdqa %xmm5,%xmm0
paddd  %xmm12,%xmm0
movdqa %xmm5,%xmm1
paddd  %xmm13,%xmm1
movdqa %xmm3,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pshufd $0xf5,%xmm0,%xmm6
pmuludq %xmm4,%xmm6
pshufd $0xe8,%xmm6,%xmm6
punpckldq %xmm6,%xmm2
movdqa %xmm3,%xmm6
pmuludq %xmm1,%xmm6
pshufd $0xe8,%xmm6,%xmm6
pshufd $0xf5,%xmm1,%xmm7
pmuludq %xmm4,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm6
movdqa %xmm8,%xmm7
psubd  %xmm0,%xmm7
movdqa %xmm8,%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm10,%xmm1
pmuludq %xmm7,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm7,%xmm7
pmuludq %xmm9,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
paddd  %xmm2,%xmm1
movdqa %xmm10,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm9,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm1,0x20(%rbx,%rdi,4)
movdqa %xmm2,0x30(%rbx,%rdi,4)
add    $0x10,%rdi
paddd  %xmm14,%xmm5
add    $0xfffffffffffffffe,%rcx
jne    1290 <main+0x160>
test   $0x1,%r9b
je     14b7 <main+0x387>
movdqa %xmm5,%xmm0
paddd  %xmm11,%xmm0
movdqa %xmm3,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm5,%xmm2
pmuludq %xmm4,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pmuludq %xmm0,%xmm3
pshufd $0xe8,%xmm3,%xmm2
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm4,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm2
movdqa %xmm8,%xmm3
psubd  %xmm5,%xmm3
psubd  %xmm0,%xmm8
movdqa %xmm10,%xmm0
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshufd $0xf5,%xmm3,%xmm3
pmuludq %xmm9,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm0
paddd  %xmm1,%xmm0
pmuludq %xmm8,%xmm10
pshufd $0xe8,%xmm10,%xmm1
pshufd $0xf5,%xmm8,%xmm3
pmuludq %xmm9,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm1
paddd  %xmm2,%xmm1
movdqa %xmm0,(%rbx,%rdi,4)
movdqa %xmm1,0x10(%rbx,%rdi,4)
cmp    %r10,%rsi
je     1180 <main+0x50>
mov    %edx,%edi
sub    %esi,%edi
imul   %r8d,%edi
mov    %eax,%ecx
imul   %esi,%ecx
add    %edi,%ecx
sub    %r8d,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,(%rbx,%rsi,4)
add    $0x1,%rsi
add    %eax,%ecx
cmp    %rsi,%r10
jne    14e0 <main+0x3b0>
jmp    1180 <main+0x50>
xor    %edi,%edi
movdqa 0xb03(%rip),%xmm5
movdqa 0xb0a(%rip),%xmm11
test   $0x1,%r9b
jne    1413 <main+0x2e3>
jmp    14b7 <main+0x387>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp eq i32 %10, 0
br i1 %12, label %127, label %13
13: ; preds = %0, %109
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %1
%18 = add nsw i32 %17, -1
store i32 %18, i32* %1
%19 = zext i32 %17 to i64
%20 = call i8* @llvm.stacksave()
%21 = alloca i32, i64 %19
%22 = load i32, i32* %1
%23 = icmp slt i32 %22, 0
br i1 %23, label %109, label %24
24: ; preds = %13
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = add nuw i32 %22, 1
%28 = zext i32 %27 to i64
%29 = icmp ult i32 %22, 7
br i1 %29, label %107, label %30
30: ; preds = %24
%31 = and i64 %28, 4294967288
%32 = insertelement <4 x i32> poison, i32 %25, i64 0
%33 = shufflevector <4 x i32> %32, <4 x i32> poison, <4 x i32> zeroinitializer
%34 = insertelement <4 x i32> poison, i32 %25, i64 0
%35 = shufflevector <4 x i32> %34, <4 x i32> poison, <4 x i32> zeroinitializer
%36 = insertelement <4 x i32> poison, i32 %22, i64 0
%37 = shufflevector <4 x i32> %36, <4 x i32> poison, <4 x i32> zeroinitializer
%38 = insertelement <4 x i32> poison, i32 %22, i64 0
%39 = shufflevector <4 x i32> %38, <4 x i32> poison, <4 x i32> zeroinitializer
%40 = insertelement <4 x i32> poison, i32 %26, i64 0
%41 = shufflevector <4 x i32> %40, <4 x i32> poison, <4 x i32> zeroinitializer
%42 = insertelement <4 x i32> poison, i32 %26, i64 0
%43 = shufflevector <4 x i32> %42, <4 x i32> poison, <4 x i32> zeroinitializer
%44 = add nsw i64 %31, -8
%45 = lshr exact i64 %44, 3
%46 = add nuw nsw i64 %45, 1
%47 = and i64 %46, 1
%48 = icmp eq i64 %44, 0
br i1 %48, label %87, label %49
49: ; preds = %30
%50 = and i64 %46, 4611686018427387902
br label %51
51: ; preds = %51, %49
%52 = phi i64 [ 0, %49 ], [ %83, %51 ]
%53 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %49 ], [ %84, %51 ]
%54 = phi i64 [ 0, %49 ], [ %85, %51 ]
%55 = add <4 x i32> %53, <i32 4, i32 4, i32 4, i32 4>
%56 = mul nsw <4 x i32> %33, %53
%57 = mul nsw <4 x i32> %35, %55
%58 = sub nsw <4 x i32> %37, %53
%59 = sub nsw <4 x i32> %39, %55
%60 = mul nsw <4 x i32> %41, %58
%61 = mul nsw <4 x i32> %43, %59
%62 = add nsw <4 x i32> %60, %56
%63 = add nsw <4 x i32> %61, %57
%64 = getelementptr inbounds i32, i32* %21, i64 %52
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %65
%66 = getelementptr inbounds i32, i32* %64, i64 4
%67 = bitcast i32* %66 to <4 x i32>*
store <4 x i32> %63, <4 x i32>* %67
%68 = or i64 %52, 8
%69 = add <4 x i32> %53, <i32 8, i32 8, i32 8, i32 8>
%70 = add <4 x i32> %53, <i32 12, i32 12, i32 12, i32 12>
%71 = mul nsw <4 x i32> %33, %69
%72 = mul nsw <4 x i32> %35, %70
%73 = sub nsw <4 x i32> %37, %69
%74 = sub nsw <4 x i32> %39, %70
%75 = mul nsw <4 x i32> %41, %73
%76 = mul nsw <4 x i32> %43, %74
%77 = add nsw <4 x i32> %75, %71
%78 = add nsw <4 x i32> %76, %72
%79 = getelementptr inbounds i32, i32* %21, i64 %68
%80 = bitcast i32* %79 to <4 x i32>*
store <4 x i32> %77, <4 x i32>* %80
%81 = getelementptr inbounds i32, i32* %79, i64 4
%82 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> %78, <4 x i32>* %82
%83 = add nuw i64 %52, 16
%84 = add <4 x i32> %53, <i32 16, i32 16, i32 16, i32 16>
%85 = add i64 %54, 2
%86 = icmp eq i64 %85, %50
br i1 %86, label %87, label %51
87: ; preds = %51, %30
%88 = phi i64 [ 0, %30 ], [ %83, %51 ]
%89 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %30 ], [ %84, %51 ]
%90 = icmp eq i64 %47, 0
br i1 %90, label %105, label %91
91: ; preds = %87
%92 = add <4 x i32> %89, <i32 4, i32 4, i32 4, i32 4>
%93 = mul nsw <4 x i32> %33, %89
%94 = mul nsw <4 x i32> %35, %92
%95 = sub nsw <4 x i32> %37, %89
%96 = sub nsw <4 x i32> %39, %92
%97 = mul nsw <4 x i32> %41, %95
%98 = mul nsw <4 x i32> %43, %96
%99 = add nsw <4 x i32> %97, %93
%100 = add nsw <4 x i32> %98, %94
%101 = getelementptr inbounds i32, i32* %21, i64 %88
%102 = bitcast i32* %101 to <4 x i32>*
store <4 x i32> %99, <4 x i32>* %102
%103 = getelementptr inbounds i32, i32* %101, i64 4
%104 = bitcast i32* %103 to <4 x i32>*
store <4 x i32> %100, <4 x i32>* %104
br label %105
105: ; preds = %87, %91
%106 = icmp eq i64 %31, %28
br i1 %106, label %109, label %107
107: ; preds = %24, %105
%108 = phi i64 [ 0, %24 ], [ %31, %105 ]
br label %117
109: ; preds = %117, %105, %13
%110 = call i32 @quickSort(i32* %21, i32 0, i32 %22)
%111 = load i32, i32* %1
%112 = add nsw i32 %111, 1
%113 = call i32 @printArray(i32* %21, i32 %112)
%114 = load i32, i32* %4
%115 = add nsw i32 %114, -1
store i32 %115, i32* %4
%116 = icmp eq i32 %114, 0
br i1 %116, label %127, label %13
117: ; preds = %107, %117
%118 = phi i64 [ %125, %117 ], [ %108, %107 ]
%119 = trunc i64 %118 to i32
%120 = mul nsw i32 %25, %119
%121 = sub nsw i32 %22, %119
%122 = mul nsw i32 %26, %121
%123 = add nsw i32 %122, %120
%124 = getelementptr inbounds i32, i32* %21, i64 %118
store i32 %123, i32* %124
%125 = add nuw nsw i64 %118, 1
%126 = icmp eq i64 %125, %28
br i1 %126, label %109, label %117
127: ; preds = %109, %0
ret i32 0
}