#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 double);
int /*<<< orphan*/ scanf(char *, int *, int *);
long double sqrt(int);
int main() {
  int v, h;
  long double ans;
  while (1) {
    scanf("%d%d", &v, &h);
    if (v == -1 && h == -1)
      break;
    ans = sqrt((2 * v * v / 9.8) * (h + ((v * v) / (2 * 9.8))));
    ;
    printf("%.6Lf\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    116c <main+0x3c>
cmpl   $0xffffffff,-0xc(%rbp)
jne    116c <main+0x3c>
jmp    11c8 <main+0x98>
mov    -0x8(%rbp),%eax
imul   %eax,%eax
mov    %eax,%ecx
add    %ecx,%ecx
cvtsi2sd %ecx,%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
movsd  0xe71(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    $0xffffffff,%eax
jne    1167 <main+0x37>
cmp    $0xffffffff,%ecx
je     11e7 <main+0xb7>
lea    0xea7(%rip),%r14
lea    0xe9b(%rip),%r15
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%rbx
nop
imul   %eax,%eax
lea    (%rax,%rax,1),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  0xe64(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
divsd  0xe5d(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
call   1050 <sqrt@plt>
fstpt  (%rsp)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    $0xffffffff,%eax
jne    1180 <main+0x50>
cmp    $0xffffffff,%ecx
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%.6Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca x86_fp80
store i32 0, i32* %1
br label %5
5: ; preds = %0, %13
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9
br label %33
13: ; preds = %9, %5
%14 = load i32, i32* %2
%15 = mul nsw i32 2, %14
%16 = load i32, i32* %2
%17 = mul nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 9.800000e+00
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = mul nsw i32 %22, %23
%25 = sitofp i32 %24 to double
%26 = fdiv double %25, 1.960000e+01
%27 = fadd double %21, %26
%28 = fmul double %19, %27
%29 = fptosi double %28 to i32
%30 = call x86_fp80 @sqrt(i32 %29)
store x86_fp80 %30, x86_fp80* %4
%31 = load x86_fp80, x86_fp80* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %31)
br label %5
33: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%.6Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -1
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %33, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %30, %11 ], [ %8, %0 ]
%13 = phi i32 [ %28, %11 ], [ %6, %0 ]
%14 = shl nsw i32 %13, 1
%15 = mul nsw i32 %14, %13
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 9.800000e+00
%18 = sitofp i32 %12 to double
%19 = mul nsw i32 %13, %13
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, 1.960000e+01
%22 = fadd double %21, %18
%23 = fmul double %17, %22
%24 = fptosi double %23 to i32
%25 = call x86_fp80 @sqrt(i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %25)
%27 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, -1
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, -1
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %33, label %11
33: ; preds = %11, %0
ret i32 0
}