#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 */
double log10(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double d, p, r;
  scanf("%lf%lf%lf", &d, &p, &r);
  if (d == 0) {
    printf("0.0\n");
    return 0;
  }
  if (d * (1 + r) - p > d || p - d * r < 0 || p / (p - d * r) < 1)
    printf("God\n");
  else {
    printf("%.1f\n", log10(p / (p - d * r)) / log10(1 + r));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1189 <main+0x59>
jp     1189 <main+0x59>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12dd <main+0x1ad>
movsd  -0x10(%rbp),%xmm0
movsd  0xe6a(%rip),%xmm2
addsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     124e <main+0x11e>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     124e <main+0x11e>
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xdbc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1261 <main+0x131>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d6 <main+0x1a6>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log10@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xd52(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
lea    0xd4d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xebd(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x20(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    117a <main+0x3a>
jp     117a <main+0x3a>
lea    0xea4(%rip),%rdi
jmp    11cf <main+0x8f>
movsd  0x8(%rsp),%xmm2
movsd  0xe78(%rip),%xmm3
addsd  %xmm2,%xmm3
movsd  0x18(%rsp),%xmm0
mulsd  %xmm1,%xmm3
subsd  %xmm0,%xmm3
ucomisd %xmm1,%xmm3
ja     11c8 <main+0x88>
mulsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
ja     11c8 <main+0x88>
divsd  %xmm2,%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11db <main+0x9b>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret
cvttsd2si %xmm0,%edi
call   1060 <log10@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xe08(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <log10@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
lea    0xe00(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11d4 <main+0x94>

LLVM IR (-O0):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [5 x i8] c"0.0\0A\00"
@.str.2 = [5 x i8] c"God\0A\00"
@.str.3 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%6 = load double, double* %2
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %54
10: ; preds = %0
%11 = load double, double* %2
%12 = load double, double* %4
%13 = fadd double 1.000000e+00, %12
%14 = load double, double* %3
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %11, double %13, double %15)
%17 = load double, double* %2
%18 = fcmp ogt double %16, %17
br i1 %18, label %35, label %19
19: ; preds = %10
%20 = load double, double* %3
%21 = load double, double* %2
%22 = load double, double* %4
%23 = fneg double %21
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double %20)
%25 = fcmp olt double %24, 0.000000e+00
br i1 %25, label %35, label %26
26: ; preds = %19
%27 = load double, double* %3
%28 = load double, double* %3
%29 = load double, double* %2
%30 = load double, double* %4
%31 = fneg double %29
%32 = call double @llvm.fmuladd.f64(double %31, double %30, double %28)
%33 = fdiv double %27, %32
%34 = fcmp olt double %33, 1.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %26, %19, %10
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %53
37: ; preds = %26
%38 = load double, double* %3
%39 = load double, double* %3
%40 = load double, double* %2
%41 = load double, double* %4
%42 = fneg double %40
%43 = call double @llvm.fmuladd.f64(double %42, double %41, double %39)
%44 = fdiv double %38, %43
%45 = fptosi double %44 to i32
%46 = call double @log10(i32 %45)
%47 = load double, double* %4
%48 = fadd double 1.000000e+00, %47
%49 = fptosi double %48 to i32
%50 = call double @log10(i32 %49)
%51 = fdiv double %46, %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %51)
br label %53
53: ; preds = %37, %35
store i32 0, i32* %1
br label %54
54: ; preds = %53, %8
%55 = load i32, i32* %1
ret i32 %55
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.3 = [6 x i8] c"%.1f\0A\00"
@str = [4 x i8] c"God\00"
@str.4 = [4 x i8] c"0.0\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
br label %37
12: ; preds = %0
%13 = load double, double* %3
%14 = fadd double %13, 1.000000e+00
%15 = load double, double* %2
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %8, double %14, double %16)
%18 = fcmp ogt double %17, %8
br i1 %18, label %26, label %19
19: ; preds = %12
%20 = fneg double %8
%21 = call double @llvm.fmuladd.f64(double %20, double %13, double %15)
%22 = fcmp olt double %21, 0.000000e+00
br i1 %22, label %26, label %23
23: ; preds = %19
%24 = fdiv double %15, %21
%25 = fcmp olt double %24, 1.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %23, %19, %12
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %37
28: ; preds = %23
%29 = fptosi double %24 to i32
%30 = call double @log10(i32 %29)
%31 = load double, double* %3
%32 = fadd double %31, 1.000000e+00
%33 = fptosi double %32 to i32
%34 = call double @log10(i32 %33)
%35 = fdiv double %30, %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %35)
br label %37
37: ; preds = %26, %28, %10
ret i32 0
}