#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 lonlen(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int N;
  int ar[10000];
  scanf("%d", &N);
  printf("\n");
  int i, l = 0, j, k = 0, count = 0;
  int len[N];
  for (i = 0; i < N; i++) {
    count = 0;
    for (j = 0; j < 10; j++) {
      scanf("%d", &ar[j]);
      count++;
    }
    int r[count];
    k = 0;
    for (j = 0; j < (count - 2); j++) {
      r[k++] = ar[j + 1] - ar[j];
    }
    r[count - 1] = 0;
    len[l++] = lonlen(r, count);
    printf("\n");
  }
  for (i = 0; i < N; i++)
    printf("%d \n", len[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9ca0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,-0x9c58(%rbp)
movl   $0x0,-0x9c60(%rbp)
movl   $0x0,-0x9c64(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x9c70(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x9c90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x9c78(%rbp)
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    134d <main+0x21d>
movl   $0x0,-0x9c64(%rbp)
movl   $0x0,-0x9c5c(%rbp)
cmpl   $0xa,-0x9c5c(%rbp)
jge    122c <main+0xfc>
movslq -0x9c5c(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdfc(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x9c64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c64(%rbp)
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    11db <main+0xab>
mov    -0x9c64(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x9c80(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x9c98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x9c88(%rbp)
movl   $0x0,-0x9c60(%rbp)
movl   $0x0,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
mov    -0x9c64(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12dd <main+0x1ad>
mov    -0x9c98(%rbp),%rax
mov    -0x9c5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    -0x9c50(%rbp,%rcx,4),%edx
movslq -0x9c5c(%rbp),%rcx
sub    -0x9c50(%rbp,%rcx,4),%edx
mov    -0x9c60(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x9c60(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    1273 <main+0x143>
mov    -0x9c98(%rbp),%rdi
mov    -0x9c64(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x0,(%rdi,%rax,4)
mov    -0x9c64(%rbp),%esi
call   1040 <lonlen@plt>
mov    %eax,%edx
mov    -0x9c90(%rbp),%rax
mov    -0x9c58(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x9c58(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c80(%rbp),%rax
mov    %rax,%rsp
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    11b8 <main+0x88>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1399 <main+0x269>
mov    -0x9c90(%rbp),%rax
movslq -0x9c54(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1357 <main+0x227>
movl   $0x0,-0x4(%rbp)
mov    -0x9c70(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%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    $0x9c58,%rsp
lea    0xea5(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    12eb <main+0x1ab>
mov    %r12,-0x38(%rbp)
xor    %r12d,%r12d
lea    0xe5f(%rip),%rbx
lea    -0x9c80(%rbp),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c7c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c78(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c74(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c70(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c6c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c68(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c64(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c60(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    -0x9c5c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rsp,%r13
mov    %rsp,%rax
lea    -0x30(%rax),%rdi
mov    %rdi,%rsp
movups -0x9c7c(%rbp),%xmm0
movaps %xmm0,%xmm1
unpcklpd -0x9c80(%rbp),%xmm1
ff
shufps $0x92,%xmm0,%xmm1
movaps %xmm0,%xmm2
psubd  %xmm1,%xmm2
movdqa %xmm2,-0x30(%rax)
movups -0x9c6c(%rbp),%xmm1
shufps $0x3,%xmm1,%xmm0
shufps $0x98,%xmm1,%xmm0
psubd  %xmm0,%xmm1
movdqa %xmm1,-0x20(%rax)
movl   $0x0,-0xc(%rax)
mov    $0xa,%esi
call   1050 <lonlen@plt>
mov    %eax,(%r15,%r12,4)
add    $0x1,%r12
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rsp
mov    -0x2c(%rbp),%eax
cmp    %r12d,%eax
jg     11b0 <main+0x70>
test   %eax,%eax
mov    -0x38(%rbp),%r12
jle    12eb <main+0x1ab>
lea    0xd39(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     12d0 <main+0x190>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%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 = [2 x i8] c"\0A\00"
@.str.2 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10000 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
store i32 0, i32* %1
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
store i32 0, i32* %7
store i32 0, i32* %8
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %9
%18 = alloca i32, i64 %16
store i64 %16, i64* %10
store i32 0, i32* %4
br label %19
19: ; preds = %78, %0
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %81
23: ; preds = %19
store i32 0, i32* %8
store i32 0, i32* %6
br label %24
24: ; preds = %34, %23
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %29
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %30)
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %34
34: ; preds = %27
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %24
37: ; preds = %24
%38 = load i32, i32* %8
%39 = zext i32 %38 to i64
%40 = call i8* @llvm.stacksave()
store i8* %40, i8** %11
%41 = alloca i32, i64 %39
store i64 %39, i64* %12
store i32 0, i32* %7
store i32 0, i32* %6
br label %42
42: ; preds = %62, %37
%43 = load i32, i32* %6
%44 = load i32, i32* %8
%45 = sub nsw i32 %44, 2
%46 = icmp slt i32 %43, %45
br i1 %46, label %47, label %65
47: ; preds = %42
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = load i32, i32* %6
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = sub nsw i32 %52, %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
%60 = sext i32 %58 to i64
%61 = getelementptr inbounds i32, i32* %41, i64 %60
store i32 %57, i32* %61
br label %62
62: ; preds = %47
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 1
store i32 %64, i32* %6
br label %42
65: ; preds = %42
%66 = load i32, i32* %8
%67 = sub nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %41, i64 %68
store i32 0, i32* %69
%70 = load i32, i32* %8
%71 = call i32 @lonlen(i32* %41, i32 %70)
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %5
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds i32, i32* %18, i64 %74
store i32 %71, i32* %75
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%77 = load i8*, i8** %11
br label %78
78: ; preds = %65
%79 = load i32, i32* %4
%80 = add nsw i32 %79, 1
store i32 %80, i32* %4
br label %19
81: ; preds = %19
store i32 0, i32* %4
br label %82
82: ; preds = %92, %81
%83 = load i32, i32* %4
%84 = load i32, i32* %2
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %95
86: ; preds = %82
%87 = load i32, i32* %4
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %18, i64 %88
%90 = load i32, i32* %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %90)
br label %92
92: ; preds = %86
%93 = load i32, i32* %4
%94 = add nsw i32 %93, 1
store i32 %94, i32* %4
br label %82
95: ; preds = %82
store i32 0, i32* %1
%96 = load i8*, i8** %9
%97 = load i32, i32* %1
ret i32 %97
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10000 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @putchar(i32 10)
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %71
13: ; preds = %0
%14 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%15 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 1
%16 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 2
%17 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 3
%18 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 4
%19 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 5
%20 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 6
%21 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 7
%22 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 8
%23 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 9
%24 = bitcast [10000 x i32]* %2 to <4 x i32>*
%25 = bitcast i32* %15 to <4 x i32>*
%26 = bitcast i32* %19 to <4 x i32>*
br label %29
27: ; preds = %29
%28 = icmp sgt i32 %60, 0
br i1 %28, label %62, label %71
29: ; preds = %13, %29
%30 = phi i64 [ 0, %13 ], [ %56, %29 ]
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %22)
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%41 = call i8* @llvm.stacksave()
%42 = alloca [10 x i32]
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %42, i64 0, i64 0
%44 = load <4 x i32>, <4 x i32>* %24
%45 = load <4 x i32>, <4 x i32>* %25
%46 = shufflevector <4 x i32> %44, <4 x i32> %45, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
%47 = sub nsw <4 x i32> %45, %46
%48 = bitcast [10 x i32]* %42 to <4 x i32>*
store <4 x i32> %47, <4 x i32>* %48
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %42, i64 0, i64 4
%50 = load <4 x i32>, <4 x i32>* %26
%51 = shufflevector <4 x i32> %45, <4 x i32> %50, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%52 = sub nsw <4 x i32> %50, %51
%53 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> %52, <4 x i32>* %53
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %42, i64 0, i64 9
store i32 0, i32* %54
%55 = call i32 @lonlen(i32* %43, i32 10)
%56 = add nuw nsw i64 %30, 1
%57 = trunc i64 %56 to i32
%58 = getelementptr inbounds i32, i32* %10, i64 %30
store i32 %55, i32* %58
%59 = call i32 @putchar(i32 10)
%60 = load i32, i32* %1
%61 = icmp sgt i32 %60, %57
br i1 %61, label %29, label %27
62: ; preds = %27, %62
%63 = phi i64 [ %67, %62 ], [ 0, %27 ]
%64 = getelementptr inbounds i32, i32* %10, i64 %63
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = add nuw nsw i64 %63, 1
%68 = load i32, i32* %1
%69 = sext i32 %68 to i64
%70 = icmp slt i64 %67, %69
br i1 %70, label %62, label %71
71: ; preds = %62, %0, %27
ret i32 0
}