#include<stdio.h>
#include <math.h>

void main(void)
{
  int time[]={30,60,90,120,150,180,210,240,270,300,330,360};
  int a,b,h,m;
  double rad;
  long  double ressult;
  scanf("%d %d %d %d",&a,&b,&h,&m);
  rad=(time[h-1]+(double)(m*6/12)-(double)(m*6));
  if(rad>180){
    rad=360-rad;
  }
  printf("%lf\n",rad);
  rad*=(M_PI/180.0);
  printf("%lf\n",cos(rad));
  ressult=(double)(a*a+b*b)-(double)(2*a*b)*cos(rad);
  printf("%.20lf\n",sqrt(ressult));
}
