program prob1
    implicit none
    integer::A, B, i, atax, btax, ataxmax, btaxmax
    read(*,*) A, B

    btax = B*10
    btaxmax = B*10+9
    if(mod(A,2) == 1)then
        atax = A*100/8 + 1
        ataxmax = atax + 11
    else
        atax = A*100/8
        ataxmax = atax + 12
    end if

    if(btax <= atax) then
        if(btaxmax >= atax)then
            write(*,*) atax
        else
            write(*,*) -1
        end if
    else
        if(ataxmax >= btax) then
            write(*,*) btax
        else
            write(*,*) -1
        end if
    end if

    stop
end program prob1
; 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.b6c68957d0051e1c7ac75390d6d7089c = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2216/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.b6c68957d0051e1c7ac75390d6d7089c, i32 4)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %2, align 4, !tbaa !3
  %8 = mul i32 %7, 10
  %9 = add i32 %8, 9
  %10 = load i32, ptr %1, align 4, !tbaa !3
  %11 = and i32 %10, -2147483647
  %12 = icmp eq i32 %11, 1
  %13 = mul i32 %10, 100
  %14 = sdiv i32 %13, 8
  %15 = zext i1 %12 to i32
  %.0 = add nsw i32 %14, %15
  %.not = icmp sgt i32 %8, %.0
  br i1 %.not, label %16, label %17

16:                                               ; preds = %0
  %.010 = add nsw i32 %14, 12
  br label %17

17:                                               ; preds = %0, %16
  %.sink = phi i32 [ %8, %16 ], [ %.0, %0 ]
  %.010.sink = phi i32 [ %.010, %16 ], [ %9, %0 ]
  %.sink20 = phi i32 [ 24, %16 ], [ 18, %0 ]
  %.sink19 = phi i32 [ 26, %16 ], [ 20, %0 ]
  %.not12 = icmp slt i32 %.010.sink, %.sink
  %.15 = select i1 %.not12, i32 %.sink19, i32 %.sink20
  %.16 = select i1 %.not12, i32 -1, i32 %.sink
  %18 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.b6c68957d0051e1c7ac75390d6d7089c, i32 %.15)
  %19 = call i1 @_FortranAioOutputInteger32(ptr %18, i32 %.16)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %21 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) 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 {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }

!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"}
