#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 *, long long);
int /*<<< orphan*/ scanf(char *, long long *, ...);
int main() {
  long long int n, a, b, c, e;
  double d;
  scanf("%lld", &n);
  while (n--) {
    scanf("%lld %lld %lld", &a, &b, &c);
    d = ((a + c) / 2.0) - b;
    if (d < 0)
      d *= -1;
    e = d;
    if (d > e)
      printf("%.2lf\n", d);
    else
      printf("%lld\n", e);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee4(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1207 <main+0xe7>
lea    0xeaf(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
add    -0x28(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    11bc <main+0x9c>
movsd  0xe56(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvttsd2si -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdq -0x30(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f2 <main+0xd2>
cvttsd2si -0x38(%rbp),%rsi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
jmp    1202 <main+0xe2>
mov    -0x30(%rbp),%rsi
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
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    0xef5(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    115a <main+0x3a>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xebf(%rip),%r14
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xeb8(%rip),%rbx
lea    0xeb8(%rip),%rbp
jmp    118d <main+0x6d>
call   1030 <printf@plt>
subq   $0x1,0x8(%rsp)
jb     1149 <main+0x29>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
add    0x20(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xe46(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq 0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
xorpd  0xe3c(%rip),%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xe27(%rip),%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
cvttsd2si %xmm2,%rsi
xorps  %xmm0,%xmm0
cvtsi2sd %rsi,%xmm0
ucomisd %xmm0,%xmm2
mov    %rbx,%rdi
ja     1180 <main+0x60>
mov    %rbp,%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [15 x i8] c"%lld %lld %lld\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
@.str.3 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %9
9: ; preds = %42, %0
%10 = load i64, i64* %2
%11 = add nsw i64 %10, -1
store i64 %11, i64* %2
%12 = icmp ne i64 %10, 0
br i1 %12, label %13, label %43
13: ; preds = %9
%14 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64* %3, i64* %4, i64* %5)
%15 = load i64, i64* %3
%16 = load i64, i64* %5
%17 = add nsw i64 %15, %16
%18 = sitofp i64 %17 to double
%19 = fdiv double %18, 2.000000e+00
%20 = load i64, i64* %4
%21 = sitofp i64 %20 to double
%22 = fsub double %19, %21
store double %22, double* %7
%23 = load double, double* %7
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %25, label %28
25: ; preds = %13
%26 = load double, double* %7
%27 = fmul double %26, -1.000000e+00
store double %27, double* %7
br label %28
28: ; preds = %25, %13
%29 = load double, double* %7
%30 = fptosi double %29 to i64
store i64 %30, i64* %6
%31 = load double, double* %7
%32 = load i64, i64* %6
%33 = sitofp i64 %32 to double
%34 = fcmp ogt double %31, %33
br i1 %34, label %35, label %39
35: ; preds = %28
%36 = load double, double* %7
%37 = fptosi double %36 to i64
%38 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %37)
br label %42
39: ; preds = %28
%40 = load i64, i64* %6
%41 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %40)
br label %42
42: ; preds = %39, %35
br label %9
43: ; preds = %9
ret i32 0
}

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