|
||||||||||
Tears of lonely starTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 123 Accepted Submission(s): 11 Problem Description Tears of lonely star------I was a drop of tear from the lonely star which hidden in you body million years before. All your feelings were seen by me, let me warm your face ! Today, we assume a lonely star is a cuboid of integral dimensions lx ¡Á ly ¡Á lz . The edges of the star are axis-aligned, and one corner of the star is located at position (0, 0, 0). Given the coordinates (x, y, z) of some arbitrary position on the surface of the lonely star, your goal is to return the square of the length of the shortest path along the star¡¯s surface from (0, 0, 0) to (x, y, z). Input The input test file will contain multiple test cases, each of which consists of six integers lx, ly , lz , x, y, z where 1 ¡Ülx, ly , lz ¡Ü 1000. Note that the star may have zero volume, but the point (x, y, z) is always guaranteed to be on one of the six sides of the star. The end-of-file is marked by a test case with lx=ly= lz = x = y = z = 0 and should not be processed. Output For each test case, write a single line with a positive integer indicating the square of the shortest path length. Sample Input
Sample Output
Author WhereIsHeroFrom Source | ||||||||||
|