#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) begin(v),end(v) template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using pii = pair; constexpr ll INF = 1ll<<30; constexpr ll longINF = 1ll<<60; constexpr ll MOD = 1000000007; constexpr bool debug = false; //---------------------------------// int main() { double r, R; cin >> r >> R; const double pi = acos(-1); double lo = pi, up = 2 * pi; REP(i, 30) { double m = (lo + up) / 2; const double x = R * cos(m), y = R * sin(m); const double d = pow(x - R, 2) + y * y; if (d <= 4 * r * r + 1e-8) up = m; else lo = m; } const double theta = up; double s = theta / 2 * (pow(R + r, 2) - pow(R - r, 2)); s += pi * r * r; printf("%.16f\n%.16f\n", theta, s); }