#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 *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int i, j, n, t;
  double a, b, c, sum;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &t);
    for (j = 1; j <= t; j++) {
      scanf("%lf %lf %lf", &a, &b, &c);
      sum = (a + b) / 2 - c;
      printf("%.2lf\n", sum);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11e5 <main+0xc5>
lea    0xead(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11d2 <main+0xb2>
lea    0xe8b(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe5b(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x4d>
jmp    11d7 <main+0xb7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x40,%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    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11e1 <main+0xc1>
mov    $0x1,%eax
lea    0xeb3(%rip),%r12
lea    0x20(%rsp),%r13
lea    0x18(%rsp),%rbx
lea    0x10(%rsp),%rbp
lea    0xea9(%rip),%r14
jmp    117e <main+0x5e>
mov    0x8(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x4(%rsp),%ecx
jge    11e1 <main+0xc1>
mov    %rax,0x8(%rsp)
lea    0xe7e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    1170 <main+0x50>
xor    %r15d,%r15d
nopl   (%rax)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
mulsd  0xe39(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%r15d
cmp    (%rsp),%r15d
jl     11a0 <main+0x80>
jmp    1170 <main+0x50>
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 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %2
br label %11
11: ; preds = %35, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %38
15: ; preds = %11
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 1, i32* %3
br label %17
17: ; preds = %31, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %6, double* %7, double* %8)
%23 = load double, double* %6
%24 = load double, double* %7
%25 = fadd double %23, %24
%26 = fdiv double %25, 2.000000e+00
%27 = load double, double* %8
%28 = fsub double %26, %27
store double %28, double* %9
%29 = load double, double* %9
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %29)
br label %31
31: ; preds = %21
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %17
34: ; preds = %17
br label %35
35: ; preds = %34
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %11
38: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 1
br i1 %13, label %36, label %14
14: ; preds = %0, %32
%15 = phi i32 [ %33, %32 ], [ 1, %0 ]
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 1
br i1 %18, label %32, label %19
19: ; preds = %14, %19
%20 = phi i32 [ %29, %19 ], [ 1, %14 ]
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5)
%22 = load double, double* %3
%23 = load double, double* %4
%24 = fadd double %22, %23
%25 = fmul double %24, 5.000000e-01
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %27)
%29 = add nuw nsw i32 %20, 1
%30 = load i32, i32* %2
%31 = icmp slt i32 %20, %30
br i1 %31, label %19, label %32
32: ; preds = %19, %14
%33 = add nuw nsw i32 %15, 1
%34 = load i32, i32* %1
%35 = icmp slt i32 %15, %34
br i1 %35, label %14, label %36
36: ; preds = %32, %0
ret i32 0
}