#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 main() {
  int cases;
  scanf("%d", &cases);
  int i;
  for (i = 0; i < cases; ++i) {
    long long third, lastthird, sum;
    scanf("%lld %lld %lld", &third, &lastthird, &sum);
    long long n = (2 * sum) / (third + lastthird);
    long long lastthirdpos = n - 2;
    long long d = (lastthird - third) / (lastthirdpos - 3);
    long long first = third - (2 * d);
    int a;
    printf("%llu\n", n);
    for (a = 0; a < n; ++a) {
      printf("%llu ", first);
      first = first + d;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122e <main+0x10e>
lea    0xea8(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
mov    -0x18(%rbp),%rcx
add    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    $0x3,%rcx
cqto
idiv   %rcx
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
movslq -0x4c(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1212 <main+0xf2>
mov    -0x48(%rbp),%rsi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11d8 <main+0xb8>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    125b <main+0x12b>
lea    0xeaf(%rip),%rbx
lea    0xeae(%rip),%rbp
xor    %r13d,%r13d
jmp    1189 <main+0x59>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    0xc(%rsp),%r13d
jge    125b <main+0x12b>
lea    0xe73(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%rax
add    %rax,%rax
mov    0x20(%rsp),%r14
mov    0x18(%rsp),%rcx
lea    (%rcx,%r14,1),%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     11e0 <main+0xb0>
cqto
idiv   %rsi
mov    %rax,%r15
jmp    11e7 <main+0xb7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
div    %esi
mov    %eax,%r15d
sub    %r14,%rcx
lea    -0x5(%r15),%rsi
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1210 <main+0xe0>
mov    %rcx,%rax
cqto
idiv   %rsi
mov    %rax,%r12
jmp    1219 <main+0xe9>
nopw   0x0(%rax,%rax,1)
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15,%r15
jle    1170 <main+0x40>
sub    %r12,%r14
sub    %r12,%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    %r12,%r14
add    $0xffffffffffffffff,%r15
jne    1240 <main+0x110>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x28,%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 = [15 x i8] c"%lld %lld %lld\00"
@.str.2 = [6 x i8] c"%llu\0A\00"
@.str.3 = [6 x i8] c"%llu \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %13
13: ; preds = %55, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %58
17: ; preds = %13
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64* %4, i64* %5, i64* %6)
%19 = load i64, i64* %6
%20 = mul nsw i64 2, %19
%21 = load i64, i64* %4
%22 = load i64, i64* %5
%23 = add nsw i64 %21, %22
%24 = sdiv i64 %20, %23
store i64 %24, i64* %7
%25 = load i64, i64* %7
%26 = sub nsw i64 %25, 2
store i64 %26, i64* %8
%27 = load i64, i64* %5
%28 = load i64, i64* %4
%29 = sub nsw i64 %27, %28
%30 = load i64, i64* %8
%31 = sub nsw i64 %30, 3
%32 = sdiv i64 %29, %31
store i64 %32, i64* %9
%33 = load i64, i64* %4
%34 = load i64, i64* %9
%35 = mul nsw i64 2, %34
%36 = sub nsw i64 %33, %35
store i64 %36, i64* %10
%37 = load i64, i64* %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %37)
store i32 0, i32* %11
br label %39
39: ; preds = %50, %17
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = load i64, i64* %7
%43 = icmp slt i64 %41, %42
br i1 %43, label %44, label %53
44: ; preds = %39
%45 = load i64, i64* %10
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %45)
%47 = load i64, i64* %10
%48 = load i64, i64* %9
%49 = add nsw i64 %47, %48
store i64 %49, i64* %10
br label %50
50: ; preds = %44
%51 = load i32, i32* %11
%52 = add nsw i32 %51, 1
store i32 %52, i32* %11
br label %39
53: ; preds = %39
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %3
%57 = add nsw i32 %56, 1
store i32 %57, i32* %3
br label %13
58: ; preds = %13
%59 = load i32, i32* %1
ret i32 %59
}

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