22070_Parallelepipedwalk

2022-5-16 18:21| 发布者: Hocassian| 查看: 23| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-8950685247400-Problem List-采集的数据-后羿采集器.html

Pro.ID

22070

Title

Parallelepiped walk

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22070

AC

1

Submit

5

Ratio

20.00%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 20000/10000 K (Java/Others)
  • 描述

    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.

    Parallelepiped dimensions L, W, H and coordinates of the points are integers, 0 <= L,W,H <= 1000.

    输入

    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.

    Parallelepiped dimensions L, W, H and coordinates of the points are integers, 0 <= L,W,H <= 1000.

    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
    3 1 2
    3 5 0

    Sample Output

    36

    Source

    样例输入

    5 5 2
    3 1 2
    3 5 0

    样例输出

    36

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部