编程介的小学生 2017-10-08 10:21 采纳率: 20.5%
浏览 864
已采纳

Parallelepiped walk

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

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-10-27 01:12
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码