#include <bits/stdc++.h>
using namespace std;
int main() {
  double A;
  double B;
  double H;
  double M;
  double k;
  double t;
  double p = 3.14159265;
  cin >> A;
  cin >> B;
  cin >> H;
  cin >> M;
  k = (30 * H - 6 * M) * p / 180.00;
  cout << k << endl;
  cout << cos(k) << endl;
  t = A * A + B * B - 2 * A * B * cos(k);
  double d = pow(d, 0.50);
  cout << t << endl;
}
