Pro.ID22070 TitleParallelepiped walk Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22070 AC1 Submit5 Ratio20.00% 时间&空间限制描述Two points A(x1, y1, z1) and B(x2, y2, z2) are placed on the surface of parallelepiped P = {(x, y, z): 0 <= x <= L, 0 <= y <= W, 0 <= z <= H} with L*W*H dimensions (see figure). These two points can be linked with various curves lying on the surface of P. You are to find out the square of the shortest curve length. 输入Input contains (in indicated order): L, W, H, x1, y1, z1, x2, y2, z2. The numbers are separated with spaces and end-of-line characters. 输出Description Two points A(x1, y1, z1) and B(x2, y2, z2) are placed on the surface of parallelepiped P = {(x, y, z): 0 <= x <= L, 0 <= y <= W, 0 <= z <= H} with L*W*H dimensions (see figure). These two points can be linked with various curves lying on the surface of P. You are to find out the square of the shortest curve length. Input Input contains (in indicated order): L, W, H, x1, y1, z1, x2, y2, z2. The numbers are separated with spaces and end-of-line characters. Output Output should contain the square of the shortest curve length between points A and B on the surface of P. Sample Input 5 5 2 Sample Output 36 Source 样例输入5 5 2 样例输出36 作者 |