program colon

 implicit none
 real::a,b,h,m
 real(8),parameter::pi=3.141592653589793
 real(8)::rad_h1,rad_h2,rad_m,cos_h,cos_m,sita,x
 read*,a,b,h,m

 rad_h1=30*pi/180
 rad_h2=0.5*pi/180
 rad_m=6*pi/180

 cos_h=rad_h1*h+rad_h2*m
 cos_m=rad_m*m

 sita=abs(cos_h-cos_m)
 
 x=sqrt(a**2+b**2-2*a*b*cos(sita))
 print*,x

end program colon
 
