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

double sin(double x);
double cos(double x);

int main(void) {

  int a, b, h, m;
  double x;
  double ra, rb, r;

  scanf("%d %d %d %d", &a, &b, &h, &m);

  if ((1000<a)||(a<1)||(1000<b)||(b<1)||(11<h)||(h<0)||(59<m)||(m<0)) {
    printf("error\n");
  }

  //ra = pow(10,5)*(h*M_PI)/6*pow(10,-5);
  //rb = pow(10,5)*(m*M_PI)/30*pow(10,-5);
  r = pow(10,5)*fabs(5*h-m)/30*pow(10,-5)*M_PI;
  printf("%f\n", r);
  printf("%f\n", M_PI/3);
  printf("%f\n", b-a*cos(r));
  printf("%f\n", a*sin(r));


  x = sqrt(pow(b-a*cos(r), 2) + pow(a*sin(r), 2));

  printf("%.15f\n", x);

  return 0;
}
