program prob4
    implicit none
    integer(8) :: n, t, ans, i
    read(*,*) n, ans 

    do i = 2, n
        read(*,*) t
        ans = lcm(ans, t)
    end do

    write(*,*) ans

    stop
contains

integer(8) function gcd(a, b)
    implicit none
    integer(8) :: a, b
    integer(8) :: l, m, n

    m = a
    n = b

    do
    l = mod(m, n)
    if (l == 0) exit
    m = n
    n = l
    end do

    gcd = n

    return
end function gcd

integer(8) function lcm(a, b)
implicit none
    integer(8) :: a, b

    lcm = a / gcd(a, b)
    lcm = lcm * b

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

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ed0d5c421101239d035658102c1bb23f, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 8)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %8 = load i64, ptr %2, align 8, !tbaa !3
  %9 = add i64 %8, -1
  %10 = icmp sgt i64 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %_QFPlcm.exit
  %11 = phi i64 [ %22, %_QFPlcm.exit ], [ %9, %0 ]
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ed0d5c421101239d035658102c1bb23f, i32 7)
  %13 = call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull %3, i32 8)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = load i64, ptr %1, align 8, !tbaa !3
  %16 = load i64, ptr %3, align 8, !tbaa !3
  br label %17

17:                                               ; preds = %17, %.lr.ph
  %.07.i.i = phi i64 [ %15, %.lr.ph ], [ %.0.i.i, %17 ]
  %.0.i.i = phi i64 [ %16, %.lr.ph ], [ %18, %17 ]
  %18 = srem i64 %.07.i.i, %.0.i.i
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %_QFPlcm.exit, label %17

_QFPlcm.exit:                                     ; preds = %17
  %20 = sdiv i64 %15, %.0.i.i
  %21 = mul i64 %20, %16
  store i64 %21, ptr %1, align 8, !tbaa !3
  %22 = add i64 %11, -1
  %23 = icmp sgt i64 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %_QFPlcm.exit, %0
  %24 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ed0d5c421101239d035658102c1bb23f, i32 11)
  %25 = load i64, ptr %1, align 8, !tbaa !3
  %26 = call i1 @_FortranAioOutputInteger64(ptr %24, i64 %25)
  %27 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %28 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read)
define i64 @_QFPgcd(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #1 {
  %3 = load i64, ptr %0, align 8, !tbaa !3
  %4 = load i64, ptr %1, align 8, !tbaa !3
  br label %5

5:                                                ; preds = %5, %2
  %.07 = phi i64 [ %3, %2 ], [ %.0, %5 ]
  %.0 = phi i64 [ %4, %2 ], [ %6, %5 ]
  %6 = srem i64 %.07, %.0
  %7 = icmp eq i64 %6, 0
  br i1 %7, label %8, label %5

8:                                                ; preds = %5
  ret i64 %.0
}

; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read)
define i64 @_QFPlcm(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #1 {
  %3 = load i64, ptr %0, align 8, !tbaa !3
  %4 = load i64, ptr %1, align 8, !tbaa !3
  br label %5

5:                                                ; preds = %5, %2
  %.07.i = phi i64 [ %3, %2 ], [ %.0.i, %5 ]
  %.0.i = phi i64 [ %4, %2 ], [ %6, %5 ]
  %6 = srem i64 %.07.i, %.0.i
  %7 = icmp eq i64 %6, 0
  br i1 %7, label %_QFPgcd.exit, label %5

_QFPgcd.exit:                                     ; preds = %5
  %8 = sdiv i64 %3, %.0.i
  %9 = mul i64 %8, %4
  ret i64 %9
}

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 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }
attributes #1 = { nofree norecurse nosync nounwind memory(argmem: read) }

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