ZOJ Problem Set - 2369
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.
This problem contains multiple test cases!
The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.
The output format consists of N output blocks. There is a blank line between output blocks.
Input file contains two real numbers R1 and R2 (1 <= R1,R2 <= 100).
Output the volume of the intersection of the cylinders. Your answer must be accurate up to 10-4.
Author: Andrew Stankevich
Source: Andrew Stankevich's Contest #3