#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 t, n, a, b, c, i, temp;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &n, &a, &b);
    if (a > b) {
      temp = a;
      a = b;
      b = temp;
    }
    for (i = n - 1; i >= 0; i--) {
      c = 0;
      c = (i * a) + ((n - 1 - i) * b);
      if (a == b) {
        printf("%d", c);
        break;
      }
      printf("%d\t", c);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1214 <main+0xf4>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    118d <main+0x6d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1201 <main+0xe1>
movl   $0x0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x1c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11e2 <main+0xc2>
mov    -0x18(%rbp),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
mov    -0x18(%rbp),%esi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1196 <main+0x76>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebf(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0x14(%rsp)
jae    1169 <main+0x39>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
lea    0xe88(%rip),%rbp
jmp    11af <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
subl   $0x1,0x14(%rsp)
jb     1158 <main+0x28>
lea    0xe4a(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%eax
cmp    %eax,%edx
jle    11e0 <main+0xb0>
mov    %eax,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %edx,%ecx
jmp    11e4 <main+0xb4>
xchg   %ax,%ax
mov    %eax,%ecx
mov    %edx,%eax
mov    0x10(%rsp),%r13d
test   %r13d,%r13d
jle    119e <main+0x6e>
lea    -0x1(%r13),%esi
imul   %eax,%esi
cmp    %ecx,%eax
je     1190 <main+0x60>
mov    $0x1,%r14d
sub    %r13d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%r13d
jb     119e <main+0x6e>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
lea    -0x2(%r13),%edx
imul   %eax,%edx
mov    0x10(%rsp),%esi
add    %r14d,%esi
imul   %ecx,%esi
add    %edx,%esi
add    $0xffffffff,%r13d
add    $0x1,%r14d
cmp    %ecx,%eax
jne    1210 <main+0xe0>
jmp    1190 <main+0x60>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [4 x i8] c"%d\09\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 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp eq i32 %10, 0
br i1 %12, label %52, label %13
13: ; preds = %0, %47
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 %16, i32* %3
store i32 %15, i32* %4
br label %19
19: ; preds = %18, %13
%20 = phi i32 [ %15, %18 ], [ %16, %13 ]
%21 = phi i32 [ %16, %18 ], [ %15, %13 ]
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %47
24: ; preds = %19
%25 = add nsw i32 %22, -1
%26 = mul nsw i32 %21, %25
%27 = icmp eq i32 %21, %20
br i1 %27, label %28, label %31
28: ; preds = %37, %24
%29 = phi i32 [ %26, %24 ], [ %45, %37 ]
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %47
31: ; preds = %24, %37
%32 = phi i32 [ %45, %37 ], [ %26, %24 ]
%33 = phi i32 [ %41, %37 ], [ %25, %24 ]
%34 = phi i32 [ %33, %37 ], [ %22, %24 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%36 = icmp ugt i32 %34, 1
br i1 %36, label %37, label %47
37: ; preds = %31
%38 = load i32, i32* %3
%39 = load i32, i32* %2
%40 = load i32, i32* %4
%41 = add nsw i32 %33, -1
%42 = mul nsw i32 %38, %41
%43 = sub i32 %39, %33
%44 = mul nsw i32 %43, %40
%45 = add nsw i32 %44, %42
%46 = icmp eq i32 %38, %40
br i1 %46, label %28, label %31
47: ; preds = %31, %19, %28
%48 = call i32 @putchar(i32 10)
%49 = load i32, i32* %1
%50 = add nsw i32 %49, -1
store i32 %50, i32* %1
%51 = icmp eq i32 %49, 0
br i1 %51, label %52, label %13
52: ; preds = %47, %0
ret i32 0
}