program ABC113B
    implicit none
    integer(8)::i
    integer(8)::N
    integer(8)::t_place
    real::T,A
    real::t_best
    real,allocatable,dimension(:)::H

    read(5,*)N
    read(5,*)T,A
    allocate(H(N))
    read(5,*)(H(i),i=1,N)
    
    do i=1,N
        if(i==1)then
            t_best=abs(A-(T-0.006*H(i)))
            t_place=i
        else if(abs(A-(T-0.006*H(i)))<t_best)then
            t_best=abs(A-(T-0.006*H(i)))
            t_place=i
        end if
    end do
    
    print'(i0)',t_place

end program ABC113B
; 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"

@_QFEh.0 = internal unnamed_addr global ptr null
@_QQcl.162fd6a4ac5cd5c884d0e51858d2c0aa = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5388/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca float, align 4
  %2 = alloca i64, align 8
  %3 = alloca float, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.162fd6a4ac5cd5c884d0e51858d2c0aa, i32 10)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.162fd6a4ac5cd5c884d0e51858d2c0aa, i32 11)
  %8 = call i1 @_FortranAioInputReal32(ptr %7, ptr nonnull %3)
  %9 = call i1 @_FortranAioInputReal32(ptr %7, ptr nonnull %1)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %11 = load i64, ptr %2, align 8, !tbaa !3
  %12 = call i64 @llvm.smax.i64(i64 %11, i64 0)
  %13 = shl i64 %12, 2
  %14 = call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEh.0, align 8, !tbaa !7
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.162fd6a4ac5cd5c884d0e51858d2c0aa, i32 13)
  %16 = load i64, ptr %2, align 8, !tbaa !3
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %18 = phi i64 [ %22, %.lr.ph ], [ 1, %0 ]
  %.unpack135 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %19 = add i64 %18, -1
  %20 = getelementptr float, ptr %.unpack135, i64 %19
  %21 = call i1 @_FortranAioInputReal32(ptr %15, ptr %20)
  %22 = add nuw i64 %18, 1
  %exitcond.not = icmp eq i64 %18, %16
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %23 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %24 = load i64, ptr %2, align 8, !tbaa !3
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %26, label %._crit_edge151

26:                                               ; preds = %._crit_edge
  %27 = load float, ptr %1, align 4
  %28 = load float, ptr %3, align 4
  %.unpack = load ptr, ptr @_QFEh.0, align 8
  %exitcond152.peel.not = icmp eq i64 %24, 1
  br i1 %exitcond152.peel.not, label %._crit_edge151, label %.peel.next.preheader

.peel.next.preheader:                             ; preds = %26
  %29 = load float, ptr %.unpack, align 4, !tbaa !3
  %30 = fmul contract float %29, 0x3F789374C0000000
  %31 = fsub contract float %28, %30
  %32 = fsub contract float %27, %31
  %33 = call contract float @llvm.fabs.f32(float %32)
  %34 = add i64 %24, -1
  %xtraiter = and i64 %34, 1
  %35 = icmp eq i64 %24, 2
  br i1 %35, label %._crit_edge151.loopexit.unr-lcssa, label %.peel.next.preheader.new

.peel.next.preheader.new:                         ; preds = %.peel.next.preheader
  %unroll_iter = and i64 %34, -2
  br label %.peel.next

.peel.next:                                       ; preds = %.peel.next, %.peel.next.preheader.new
  %36 = phi i64 [ 2, %.peel.next.preheader.new ], [ %53, %.peel.next ]
  %.0148 = phi i64 [ 1, %.peel.next.preheader.new ], [ %.1.1, %.peel.next ]
  %.096147 = phi float [ %33, %.peel.next.preheader.new ], [ %.197.1, %.peel.next ]
  %niter = phi i64 [ 0, %.peel.next.preheader.new ], [ %niter.next.1, %.peel.next ]
  %37 = add i64 %36, -1
  %38 = getelementptr float, ptr %.unpack, i64 %37
  %39 = load float, ptr %38, align 4, !tbaa !3
  %40 = fmul contract float %39, 0x3F789374C0000000
  %41 = fsub contract float %28, %40
  %42 = fsub contract float %27, %41
  %43 = call contract float @llvm.fabs.f32(float %42)
  %44 = fcmp olt float %43, %.096147
  %.197 = select i1 %44, float %43, float %.096147
  %.1 = select i1 %44, i64 %36, i64 %.0148
  %45 = or i64 %36, 1
  %46 = getelementptr float, ptr %.unpack, i64 %36
  %47 = load float, ptr %46, align 4, !tbaa !3
  %48 = fmul contract float %47, 0x3F789374C0000000
  %49 = fsub contract float %28, %48
  %50 = fsub contract float %27, %49
  %51 = call contract float @llvm.fabs.f32(float %50)
  %52 = fcmp olt float %51, %.197
  %.197.1 = select i1 %52, float %51, float %.197
  %.1.1 = select i1 %52, i64 %45, i64 %.1
  %53 = add nuw i64 %36, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge151.loopexit.unr-lcssa, label %.peel.next, !llvm.loop !9

._crit_edge151.loopexit.unr-lcssa:                ; preds = %.peel.next, %.peel.next.preheader
  %.1.lcssa.ph = phi i64 [ undef, %.peel.next.preheader ], [ %.1.1, %.peel.next ]
  %.unr = phi i64 [ 2, %.peel.next.preheader ], [ %53, %.peel.next ]
  %.0148.unr = phi i64 [ 1, %.peel.next.preheader ], [ %.1.1, %.peel.next ]
  %.096147.unr = phi float [ %33, %.peel.next.preheader ], [ %.197.1, %.peel.next ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge151, label %.peel.next.epil

.peel.next.epil:                                  ; preds = %._crit_edge151.loopexit.unr-lcssa
  %54 = add i64 %.unr, -1
  %55 = getelementptr float, ptr %.unpack, i64 %54
  %56 = load float, ptr %55, align 4, !tbaa !3
  %57 = fmul contract float %56, 0x3F789374C0000000
  %58 = fsub contract float %28, %57
  %59 = fsub contract float %27, %58
  %60 = call contract float @llvm.fabs.f32(float %59)
  %61 = fcmp olt float %60, %.096147.unr
  %.1.epil = select i1 %61, i64 %.unr, i64 %.0148.unr
  br label %._crit_edge151

._crit_edge151:                                   ; preds = %.peel.next.epil, %._crit_edge151.loopexit.unr-lcssa, %26, %._crit_edge
  %.0.lcssa = phi i64 [ undef, %._crit_edge ], [ 1, %26 ], [ %.1.lcssa.ph, %._crit_edge151.loopexit.unr-lcssa ], [ %.1.epil, %.peel.next.epil ]
  %62 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.162fd6a4ac5cd5c884d0e51858d2c0aa, i32 25)
  %63 = call i1 @_FortranAioOutputInteger64(ptr %62, i64 %.0.lcssa)
  %64 = call i32 @_FortranAioEndIoStatement(ptr %62)
  ret void
}

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 i1 @_FortranAioInputReal32(ptr, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, 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 float @llvm.fabs.f32(float) #1

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.peeled.count", i32 1}
