#include <bits/stdc++.h>
using namespace std;

constexpr double pi = acos(-1);

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  double r, R;
  cin >> r >> R;
  cout << fixed << setprecision(15) << 2 * pi - asin(r / R) * 2 << '\n';
  auto sq = [](double x) { return x * x; };
  double res = (sq(R + r) - sq(R - r)) * (pi - asin(r / R)) + pi * r * r;
  cout << fixed << setprecision(15) << res << '\n';
}