import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import asin, pi r, R = map(float, read().split()) theta = asin(r / R) t = 2 * pi - 2 * theta S = 2 * R * r * t S += r * r * pi print(t) print(S)