• [1447] Hello World

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • 那是一个夜黑风高的晚上。

    CC wannts to visit TT, so he starts from his house to TT's house. But he got injured yesterday, so he wants to walk the shortest way to arrive TT's house.


    Both thier houses are rectangles. Can you find the shortest distance from one to another?

  • 输入
  • There are several test cases.
    The first line, an integer T indicates the test cases.
    Next two lines, each line contains one rectangle's two points' coordinates(x, y). One point is left and below, and another is right and top. (-10000.0 <= x, y <= 10000.0).
  • 输出
  • Print the shortest distance from one to another, Retained four decimal places.
  • 样例输入
  • 1
    0.0 0.0 1.0 1.0
    2.0 2.0 3.0 3.0
    
  • 样例输出
  • 1.4142
    
  • 提示
  • 这两个矩形一定是分离的,没有相交,没有相切,也没有包含。
    
  • 来源
  • Hungar
  • 操作

显示春菜