#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 *, float);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int t;
  int a, b, c;
  float d1, d2, min;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &a, &b, &c);
    d1 = b - a;
    d2 = c - b;
    if (d1 == d2)
      min = 0;
    else {
      min = (d1 + d2) / 2;
      min = b - a - min;
      if (min < 0)
        min = -min;
    }
    printf("%0.2f\n", min);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     121d <main+0xfd>
lea    0xea8(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jne    11af <main+0x8f>
jp     11af <main+0x8f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1207 <main+0xe7>
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  0xe3f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1202 <main+0xe2>
movss  -0x20(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1207 <main+0xe7>
movss  -0x20(%rbp),%xmm0
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,(%rsp)
jae    1154 <main+0x34>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xec5(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%r13
lea    0xeb6(%rip),%rbx
jmp    118e <main+0x6e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <printf@plt>
subl   $0x1,(%rsp)
jb     1144 <main+0x24>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,%ecx
sub    0xc(%rsp),%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mov    0x4(%rsp),%ecx
sub    %eax,%ecx
xorps  %xmm2,%xmm2
cvtsi2ss %ecx,%xmm2
ucomiss %xmm2,%xmm1
xorps  %xmm0,%xmm0
jne    11c9 <main+0xa9>
jnp    1180 <main+0x60>
addss  %xmm1,%xmm2
mulss  0xe2b(%rip),%xmm2
movaps %xmm2,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1180 <main+0x60>
xorps  0xe25(%rip),%xmm0
jmp    1180 <main+0x60>

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

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