#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 < 5; 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];
    }
    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    133b <main+0x20b>
movl   $0x0,-0x9c64(%rbp)
movl   $0x0,-0x9c5c(%rbp)
cmpl   $0x5,-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),%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    0xcf0(%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    1387 <main+0x257>
mov    -0x9c90(%rbp),%rax
movslq -0x9c54(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1345 <main+0x215>
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    128b <main+0x14b>
mov    %r12,-0x38(%rbp)
xor    %r12d,%r12d
lea    0xe5f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    -0x9c80(%rbp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    -0x9c7c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    -0x9c78(%rbp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    -0x9c74(%rbp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    -0x9c70(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rsp,%r13
mov    %rsp,%rax
lea    -0x20(%rax),%rdi
mov    %rdi,%rsp
mov    -0x9c7c(%rbp),%ecx
mov    -0x9c78(%rbp),%edx
mov    %edx,%esi
sub    %ecx,%esi
sub    -0x9c80(%rbp),%ecx
mov    -0x9c74(%rbp),%ebx
sub    %edx,%ebx
mov    %ecx,-0x20(%rax)
mov    %esi,-0x1c(%rax)
mov    %ebx,-0x18(%rax)
mov    $0x5,%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    128b <main+0x14b>
lea    0xd9a(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
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     1270 <main+0x130>
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 = %74, %0
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %77
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, 5
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 = call i32 @lonlen(i32* %41, i32 %66)
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 1
store i32 %69, i32* %5
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds i32, i32* %18, i64 %70
store i32 %67, i32* %71
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%73 = load i8*, i8** %11
br label %74
74: ; preds = %65
%75 = load i32, i32* %4
%76 = add nsw i32 %75, 1
store i32 %76, i32* %4
br label %19
77: ; preds = %19
store i32 0, i32* %4
br label %78
78: ; preds = %88, %77
%79 = load i32, i32* %4
%80 = load i32, i32* %2
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %91
82: ; preds = %78
%83 = load i32, i32* %4
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %18, i64 %84
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %86)
br label %88
88: ; preds = %82
%89 = load i32, i32* %4
%90 = add nsw i32 %89, 1
store i32 %90, i32* %4
br label %78
91: ; preds = %78
store i32 0, i32* %1
%92 = load i8*, i8** %9
%93 = load i32, i32* %1
ret i32 %93
}

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 %56
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
br label %21
19: ; preds = %21
%20 = icmp sgt i32 %45, 0
br i1 %20, label %47, label %56
21: ; preds = %13, %21
%22 = phi i64 [ 0, %13 ], [ %41, %21 ]
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%28 = call i8* @llvm.stacksave()
%29 = alloca [5 x i32]
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %29, i64 0, i64 0
%31 = load i32, i32* %15
%32 = load i32, i32* %14
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %30
%34 = load i32, i32* %16
%35 = sub nsw i32 %34, %31
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %29, i64 0, i64 1
store i32 %35, i32* %36
%37 = load i32, i32* %17
%38 = sub nsw i32 %37, %34
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %29, i64 0, i64 2
store i32 %38, i32* %39
%40 = call i32 @lonlen(i32* %30, i32 5)
%41 = add nuw nsw i64 %22, 1
%42 = trunc i64 %41 to i32
%43 = getelementptr inbounds i32, i32* %10, i64 %22
store i32 %40, i32* %43
%44 = call i32 @putchar(i32 10)
%45 = load i32, i32* %1
%46 = icmp sgt i32 %45, %42
br i1 %46, label %21, label %19
47: ; preds = %19, %47
%48 = phi i64 [ %52, %47 ], [ 0, %19 ]
%49 = getelementptr inbounds i32, i32* %10, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = add nuw nsw i64 %48, 1
%53 = load i32, i32* %1
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %47, label %56
56: ; preds = %47, %0, %19
ret i32 0
}