#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 abs(long double);
int /*<<< orphan*/ printf(char *, long double);
int /*<<< orphan*/ scanf(char *, ...);
long double sqrt(long double);
int main() {
  long double L, S1, S2, length;
  int Q;
  int speed;
  scanf("%Lg %Lg %Lg", &L, &S1, &S2);
  scanf("%d", &Q);
  speed = abs(S1 - S2);
  length = sqrt(L * L * 2);
  while (Q-- > 0) {
    long double q;
    long double t;
    scanf("%Lg", &q);
    t = (length - sqrt(q * 2)) / speed;
    printf("%.20Lf\n", t >= 0 ? t : 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x85(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x85(%rbp),%al
lea    0xe8d(%rip),%rdi
lea    -0x54(%rbp),%rsi
call   1050 <scanf@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fsubrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <abs@plt>
mov    %eax,-0x58(%rbp)
fldt   -0x20(%rbp)
fmul   %st,%st(0)
fadd   %st,%st(0)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <sqrt@plt>
fstpt  -0x50(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x54(%rbp)
cmp    $0x0,%eax
jle    1258 <main+0x118>
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
lea    -0x70(%rbp),%rsi
call   1050 <scanf@plt>
fldt   -0x50(%rbp)
fstpt  -0x90(%rbp)
fldt   -0x70(%rbp)
fadd   %st,%st(0)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <sqrt@plt>
fldt   -0x90(%rbp)
fsubp  %st,%st(1)
mov    -0x58(%rbp),%eax
mov    %eax,-0x84(%rbp)
fildl  -0x84(%rbp)
fdivrp %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     122f <main+0xef>
jmp    1221 <main+0xe1>
fldt   -0x80(%rbp)
fstpt  -0x9c(%rbp)
jmp    123c <main+0xfc>
fldz
fstpt  -0x9c(%rbp)
jmp    123c <main+0xfc>
fldt   -0x9c(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xdc1(%rip),%rdi
call   1040 <printf@plt>
jmp    11b1 <main+0x71>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xead(%rip),%rdi
lea    0x70(%rsp),%rsi
lea    0x60(%rsp),%rdx
lea    0x50(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9c(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
fldt   0x60(%rsp)
fldt   0x50(%rsp)
fsubrp %st,%st(1)
fstpt  (%rsp)
call   1030 <abs@plt>
mov    %eax,%ebx
fldt   0x70(%rsp)
fmul   %st,%st(0)
fadd   %st,%st(0)
fld    %st(0)
fsqrt
fstpt  0x28(%rsp)
fldz
fld    %st(0)
fstpt  0x1c(%rsp)
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jae    11be <main+0x7e>
fstpt  (%rsp)
call   1060 <sqrt@plt>
fstpt  0x28(%rsp)
fldz
fstp   %st(0)
mov    0x14(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x14(%rsp)
test   %eax,%eax
fldt   0x1c(%rsp)
fstp   %st(0)
jle    126b <main+0x12b>
mov    %ebx,0x18(%rsp)
fildl  0x18(%rsp)
fstpt  0x34(%rsp)
lea    0xe1c(%rip),%r14
lea    0x40(%rsp),%r15
lea    0xe17(%rip),%rbx
jmp    1230 <main+0xf0>
nopw   0x0(%rax,%rax,1)
fstp   %st(0)
fldt   0x28(%rsp)
fsubp  %st,%st(1)
fldt   0x34(%rsp)
fdivrp %st,%st(1)
fucomi %st(1),%st
fxch   %st(1)
fcmovnb %st(1),%st
fstp   %st(1)
fstpt  (%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x14(%rsp)
test   %eax,%eax
jle    126b <main+0x12b>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
fldt   0x40(%rsp)
fadd   %st,%st(0)
fld    %st(0)
fsqrt
fldt   0x1c(%rsp)
fxch   %st(2)
fucomi %st(2),%st
jae    1200 <main+0xc0>
fstp   %st(1)
fstp   %st(1)
fstpt  (%rsp)
call   1060 <sqrt@plt>
fldt   0x1c(%rsp)
fldz
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
jmp    1200 <main+0xc0>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%Lg %Lg %Lg\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%Lg\00"
@.str.3 = [8 x i8] c"%.20Lf\0A\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca i32
%5 = alloca x86_fp80
%6 = bitcast x86_fp80* %1 to i8*
%7 = bitcast x86_fp80* %2 to i8*
%8 = bitcast x86_fp80* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), x86_fp80* %1, x86_fp80* %2, x86_fp80* %3)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = load x86_fp80, x86_fp80* %2
%13 = load x86_fp80, x86_fp80* %3
%14 = fsub x86_fp80 %12, %13
%15 = call i32 @abs(x86_fp80 %14)
%16 = load x86_fp80, x86_fp80* %1
%17 = fmul x86_fp80 %16, %16
%18 = fmul x86_fp80 %17, 0xK40008000000000000000
%19 = call x86_fp80 @sqrt(x86_fp80 %18)
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
%22 = icmp sgt i32 %20, 0
br i1 %22, label %23, label %39
23: ; preds = %0
%24 = bitcast x86_fp80* %5 to i8*
%25 = sitofp i32 %15 to x86_fp80
br label %26
26: ; preds = %23, %26
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), x86_fp80* %5)
%28 = load x86_fp80, x86_fp80* %5
%29 = fmul x86_fp80 %28, 0xK40008000000000000000
%30 = call x86_fp80 @sqrt(x86_fp80 %29)
%31 = fsub x86_fp80 %19, %30
%32 = fdiv x86_fp80 %31, %25
%33 = fcmp oge x86_fp80 %32, 0xK00000000000000000000
%34 = select i1 %33, x86_fp80 %32, x86_fp80 0xK00000000000000000000
%35 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %34)
%36 = load i32, i32* %4
%37 = add nsw i32 %36, -1
store i32 %37, i32* %4
%38 = icmp sgt i32 %36, 0
br i1 %38, label %26, label %39
39: ; preds = %26, %0
ret i32 0
}