      PROGRAM Colon
      IMPLICIT NONE
      integer,parameter :: p = 16
      real(p),parameter :: pi=3.1415926535897932384626433832795028
   !   real(p) :: pi = atan(real(1_16))*4
      real(p) :: a,b,h,m, ans2
      real(p) :: angleA,angleB,angleSub
      real(p) :: xa,ya,xb,yb
      
      
      read*,a,b,h,m
      h = h + m/60d0
      
      angleA = h/12d0*2*pi
      angleB = m/60d0*2*pi
      print*,angleB
      
      xa = a*sin(angleA)
      ya = a*cos(angleA)
      xb = b*sin(angleB)
      yb = b*cos(angleB)
      
      print*, sqrt( (xa-xb)**2 + (ya-yb)**2 )
      
      
      
      END PROGRAM