22799_TexasTrip

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

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

Pro.ID

22799

Title

Texas Trip

Title链接

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

AC

4

Submit

7

Ratio

57.14%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    After a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tires tore sells fiberglass patching material only in square sheets. What is the smallest patch that Harry needs to fix his door?

    Assume that the holes are points on the integer lattice in the plane. Your job is to find the area of the smallest square that will cover all the holes.

    输入

    The first line of input contains a single integer T expressed in decimal with no leading zeroes, denoting the number of test cases to follow. The subsequent lines of input describe the test cases.

    Each test case begins with a single line, containing a single integer n expressed indecimal with no leading zeroes, the number of points to follow; each of the following n lines contains two integers x and y, both expressed in decimal with no leading zeroes, giving the coordinates of one of your points.

    You are guaranteed that T ≤ 30 and that no data set contains more than 30 points. All points in each data set will be no more than 500 units away from (0, 0).

    输出

    Description

    After a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tires tore sells fiberglass patching material only in square sheets. What is the smallest patch that Harry needs to fix his door?

    Assume that the holes are points on the integer lattice in the plane. Your job is to find the area of the smallest square that will cover all the holes.

    Input

    The first line of input contains a single integer T expressed in decimal with no leading zeroes, denoting the number of test cases to follow. The subsequent lines of input describe the test cases.

    Each test case begins with a single line, containing a single integer n expressed indecimal with no leading zeroes, the number of points to follow; each of the following n lines contains two integers x and y, both expressed in decimal with no leading zeroes, giving the coordinates of one of your points.

    You are guaranteed that T ≤ 30 and that no data set contains more than 30 points. All points in each data set will be no more than 500 units away from (0, 0).

    Output

    For each test case, print, on a single line with two decimal places of precision, the area of the smallest square containing all of your points.

    Sample Input

    2
    4
    -1 -1
    1 -1
    1 1
    -1 1
    4
    10 1
    10 -1
    -10 1
    -10 -1

    Sample Output

    4.00
    242.00

    Source

    样例输入

    2
    4
    -1 -1
    1 -1
    1 1
    -1 1
    4
    10 1
    10 -1
    -10 1
    -10 -1

    样例输出

    4.00
    242.00

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部