0165. Two Cylinders

Input file name: twocyl.in
Output file name: twocyl.out
Time limit: 2 s
Memory limit: 32 megabytes

In this problem your task is very simple.

Consider two infinite cylinders in three-dimensional space, of radii R1 and R2 respectively, located in such a way that their axes intersect and are perpendicular.

Your task is to find the volume of their intersection.

Input file

Input file contains two real numbers R1 and R2 (1 ≤ R1, R2 ≤ 100);

Output file

Output the volume of the intersection of the cylinders. Your answer must be accurate up to 10-4.

Examples:

twocyl.intwocyl.out
1 1 5.3333


Source: Petrozavodsk Summer 2003. Final Contest, Saturday, August 30
Author: Andrew Stankevich

Discuss       Submit a solution



Printable version