import math
r=float(input())
x=float(input())
ops=int(input())
VE=(4*math.pi*r**3)/3
VC=(math.pi*(x**2)*((3*r)-x))/3
if (ops==2):
	print(round(VE-VC,4))
if (ops==1):
	print(round(VC,4))
e66cb2ba2ea05d1b57790bbe8f273420ed7c992c
<mask token>

<mask token>
if ops == 2:
    print(round(VE - VC, 4))
if ops == 1:
    print(round(VC, 4))

<mask token>
r = float(input())
x = float(input())
ops = int(input())
VE = 4 * math.pi * r ** 3 / 3
VC = math.pi * x ** 2 * (3 * r - x) / 3
if ops == 2:
    print(round(VE - VC, 4))
if ops == 1:
    print(round(VC, 4))

import math
r = float(input())
x = float(input())
ops = int(input())
VE = 4 * math.pi * r ** 3 / 3
VC = math.pi * x ** 2 * (3 * r - x) / 3
if ops == 2:
    print(round(VE - VC, 4))
if ops == 1:
    print(round(VC, 4))

import math
r=float(input())
x=float(input())
ops=int(input())
VE=(4*math.pi*r**3)/3
VC=(math.pi*(x**2)*((3*r)-x))/3
if (ops==2):
	print(round(VE-VC,4))
if (ops==1):
	print(round(VC,4))