program Tax_Increase
    implicit none
    real(8):: a,b
    integer(8):: amax, bmax, amin, bmin

    read*, a,b


    amin = ceiling((a)/8d-2)
    amax = ceiling((a+1)/8d-2)-1
    bmin = ceiling((b)/10d-2)
    bmax = ceiling((b+1)/1d-1)-1

    if (amax < bmin .or. bmax < amin) then
        print*, -1
    else
        print*, max(amin,bmin)
    end if

end program Tax_Increase
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.b9bfd0d89f84ca303d2ea7e4bfd64761 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2209/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.b9bfd0d89f84ca303d2ea7e4bfd64761, i32 6)
  %4 = call i1 @_FortranAioInputReal64(ptr %3, ptr nonnull %1)
  %5 = call i1 @_FortranAioInputReal64(ptr %3, ptr nonnull %2)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load double, ptr %1, align 8, !tbaa !3
  %8 = fdiv contract double %7, 8.000000e-02
  %9 = call contract double @llvm.ceil.f64(double %8)
  %10 = fptosi double %9 to i32
  %11 = fadd contract double %7, 1.000000e+00
  %12 = fdiv contract double %11, 8.000000e-02
  %13 = call contract double @llvm.ceil.f64(double %12)
  %14 = fptosi double %13 to i32
  %15 = add i32 %14, -1
  %16 = load double, ptr %2, align 8, !tbaa !3
  %17 = fdiv contract double %16, 1.000000e-01
  %18 = call contract double @llvm.ceil.f64(double %17)
  %19 = fptosi double %18 to i32
  %20 = fadd contract double %16, 1.000000e+00
  %21 = fdiv contract double %20, 1.000000e-01
  %22 = call contract double @llvm.ceil.f64(double %21)
  %23 = fptosi double %22 to i32
  %24 = add i32 %23, -1
  %25 = icmp slt i32 %15, %19
  %26 = icmp slt i32 %24, %10
  %27 = or i1 %25, %26
  br i1 %27, label %28, label %31

28:                                               ; preds = %0
  %29 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.b9bfd0d89f84ca303d2ea7e4bfd64761, i32 15)
  %30 = call i1 @_FortranAioOutputInteger32(ptr %29, i32 -1)
  br label %36

31:                                               ; preds = %0
  %32 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.b9bfd0d89f84ca303d2ea7e4bfd64761, i32 17)
  %33 = call i32 @llvm.smax.i32(i32 %10, i32 %19)
  %34 = sext i32 %33 to i64
  %35 = call i1 @_FortranAioOutputInteger64(ptr %32, i64 %34)
  br label %36

36:                                               ; preds = %28, %31
  %.sink = phi ptr [ %29, %28 ], [ %32, %31 ]
  %37 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
