#include <bits/stdc++.h>
using namespace std;
constexpr long double PI = 3.1415926535897932384626433;
//Euclidean distance
template<class T> T EucDist(T x1, T y1, T x2, T y2) {
    return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
}

int main() {
	double r,R,ok = 180., ng = 360., md,x,y,d;
    cin >> r >> R;
	for(int i = 0; i < 1000000; ++i){
		md = (ok+ng)/2.;
		x = R*cos(md/180.*PI);
		y = R*sin(md/180.*PI);
		d = EucDist(x,y,R,0.);
		(2*r<=d?ok:ng)=md;
	}
	double area = PI*((R+r)*(R+r)-(R-r)*(R-r))*ok/360. + PI*r*r;
	double t = PI*ok/180.;
	printf("%.10f\n",t);
	printf("%.10f\n",area);
}