Solution to ACM/ICPC Problem 4070/Sphere Online Judge Problem TWOPROF