program prob5
    implicit none
    integer(16)::N, K, ans
    read(*,*) N, K
    ans = 0
    if(mod(K,2) == 0)then
        ans = ans + ((N+K/2)/K)**3 !それぞれが倍数/2
        ans = ans + (N/K)**3 !それぞれが倍数
    else
        ans = ans + (N/K)**3 !それぞれが倍数
    end if
    write(*,*) ans
    stop
end program
; 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.0e4d74ed7f63988f69fdceef257d6234 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5590/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

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

.lr.ph.i:                                         ; preds = %0
  %11 = sdiv i128 %7, 2
  %12 = add i128 %10, %11
  %13 = sdiv i128 %12, %7
  %14 = trunc i128 %13 to i8
  %15 = mul i8 %14, %14
  %spec.select.i = mul i8 %15, %14
  %16 = sext i8 %spec.select.i to i128
  %17 = sdiv i128 %10, %7
  %18 = trunc i128 %17 to i8
  %19 = mul i8 %18, %18
  %spec.select.i6 = mul i8 %19, %18
  %20 = sext i8 %spec.select.i6 to i128
  %21 = add nsw i128 %20, %16
  br label %26

.lr.ph.i12:                                       ; preds = %0
  %22 = sdiv i128 %10, %7
  %23 = trunc i128 %22 to i8
  %24 = mul i8 %23, %23
  %spec.select.i11 = mul i8 %24, %23
  %25 = sext i8 %spec.select.i11 to i128
  br label %26

26:                                               ; preds = %.lr.ph.i, %.lr.ph.i12
  %.0 = phi i128 [ %21, %.lr.ph.i ], [ %25, %.lr.ph.i12 ]
  %27 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.0e4d74ed7f63988f69fdceef257d6234, i32 12)
  %28 = call i1 @_FortranAioOutputInteger128(ptr %27, i128 %.0)
  %29 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %30 = 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 @_FortranAioOutputInteger128(ptr, i128) 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"}
