program main
	implicit none
	integer(8):: A,B,H,M,i,j,k
	double precision::kai,pi=dacos(-1d0),t,s
	read *, A,B,H,M	
	s=dble(H)+dble(M)/60d0
	t=(30d0*s-6d0*dble(M))
	kai=sqrt(dble(A*A)+dble(B*B)&
		-2d0*dble(A*B)*dcos(t/180d0*pi))
	
	 print '(f0.14)', kai
end program main
; 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.26933ab3e57504f531444feae65f2220 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1378/source.f\00"
@_QQcl.2866302E313429 = linkonce constant [7 x i8] c"(f0.14)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.26933ab3e57504f531444feae65f2220, i32 5)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %1, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 8)
  %8 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 8)
  %9 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 8)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %11 = load i64, ptr %3, align 8, !tbaa !3
  %12 = sitofp i64 %11 to double
  %13 = load i64, ptr %4, align 8, !tbaa !3
  %14 = sitofp i64 %13 to double
  %15 = fdiv contract double %14, 6.000000e+01
  %16 = fadd contract double %15, %12
  %17 = fmul contract double %16, 3.000000e+01
  %18 = fmul contract double %14, 6.000000e+00
  %19 = fsub contract double %17, %18
  %20 = load i64, ptr %1, align 8, !tbaa !3
  %21 = mul i64 %20, %20
  %22 = sitofp i64 %21 to double
  %23 = load i64, ptr %2, align 8, !tbaa !3
  %24 = mul i64 %23, %23
  %25 = sitofp i64 %24 to double
  %26 = fadd contract double %22, %25
  %27 = mul i64 %23, %20
  %28 = sitofp i64 %27 to double
  %29 = fmul contract double %28, 2.000000e+00
  %30 = fdiv contract double %19, 1.800000e+02
  %31 = fmul contract double %30, 0x400921FB54442D18
  %32 = call contract double @llvm.cos.f64(double %31)
  %33 = fmul contract double %29, %32
  %34 = fsub contract double %26, %33
  %35 = call contract double @llvm.sqrt.f64(double %34)
  %36 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2866302E313429, i64 7, ptr null, i32 -1, ptr nonnull @_QQcl.26933ab3e57504f531444feae65f2220, i32 11)
  %37 = call i1 @_FortranAioOutputReal64(ptr %36, double %35)
  %38 = call i32 @_FortranAioEndIoStatement(ptr %36)
  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 ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputReal64(ptr, double) local_unnamed_addr

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

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

attributes #0 = { mustprogress 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"}
