#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
double solve(double, double);
int main() {
  int n, i;
  double b, h, c;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf%lf", &b, &h);
    b *= 1000000;
    h *= 1000000;
    c = solve(b, h);
    printf("%13.6f\n", c / 1000000);
    if (i != (n - 1))
      printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1203 <main+0xd3>
lea    0xea0(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movsd  0xe7e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe6c(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <solve@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe41(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11f0 <main+0xc0>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f5 <main+0xc5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1201 <main+0xc1>
lea    0xe9a(%rip),%r14
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe90(%rip),%rbx
xor    %ebp,%ebp
jmp    1197 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %eax,%ebp
jge    1201 <main+0xc1>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <solve@plt>
divsd  0xe24(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    %ecx,%ebp
je     1190 <main+0x50>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0xc(%rsp),%eax
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%lf%lf\00"
@.str.2 = [8 x i8] c"%13.6f\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %31, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %34
12: ; preds = %8
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5)
%14 = load double, double* %4
%15 = fmul double %14, 1.000000e+06
store double %15, double* %4
%16 = load double, double* %5
%17 = fmul double %16, 1.000000e+06
store double %17, double* %5
%18 = load double, double* %4
%19 = load double, double* %5
%20 = call double @solve(double %18, double %19)
store double %20, double* %6
%21 = load double, double* %6
%22 = fdiv double %21, 1.000000e+06
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, 1
%27 = icmp ne i32 %24, %26
br i1 %27, label %28, label %30
28: ; preds = %12
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %12
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %8
34: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%lf%lf\00"
@.str.2 = [8 x i8] c"%13.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %0, %26
%11 = phi i32 [ %28, %26 ], [ 0, %0 ]
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%13 = load double, double* %2
%14 = fmul double %13, 1.000000e+06
store double %14, double* %2
%15 = load double, double* %3
%16 = fmul double %15, 1.000000e+06
store double %16, double* %3
%17 = call double @solve(double %14, double %16)
%18 = fdiv double %17, 1.000000e+06
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
%22 = icmp eq i32 %11, %21
br i1 %22, label %26, label %23
23: ; preds = %10
%24 = call i32 @putchar(i32 10)
%25 = load i32, i32* %1
br label %26
26: ; preds = %10, %23
%27 = phi i32 [ %20, %10 ], [ %25, %23 ]
%28 = add nuw nsw i32 %11, 1
%29 = icmp slt i32 %28, %27
br i1 %29, label %10, label %30
30: ; preds = %26, %0
ret i32 0
}