#!/usr/bin/env python3 import math r = float(input()) R = float(input()) t = 2 * math.pi - 2 * math.asin(r / R) a0 = math.pi * (R + r) ** 2 - math.pi * (R - r) ** 2 a = a0 * (t / (2 * math.pi)) + math.pi * r ** 2 print(t) print(a)