21583_KidsLikeCakes

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

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

Pro.ID

21583

Title

Kids Like Cakes

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 10000/5000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Kids like cakes. It's obvious. In this problem, we consider only cakes having the form of a convex polygon, as viewed from above.

    Every cake needs to be split into pieces. In this problem, every piece should have a form of a nondegenerate triangle with vertices at original cake's vertices. The pieces may not intersect, and their union should form the original cake.

    Some kids also like fairness. Let's call the unfairness number of a cake the maximal possible difference between the areas of the largest and the smallest pieces of it.

    Your task is to find the unfairness number of a given cake.

    输入

    The first line of the input file contains a single integer number n — the number of vertices of the cake (4 ≤ n ≤ 5000). The following n lines contain two integers xi, yi each — the coordinates of the vertices (-108xi, yi ≤ 108).

    输出

    Description

    Kids like cakes. It's obvious. In this problem, we consider only cakes having the form of a convex polygon, as viewed from above.

    Every cake needs to be split into pieces. In this problem, every piece should have a form of a nondegenerate triangle with vertices at original cake's vertices. The pieces may not intersect, and their union should form the original cake.

    Some kids also like fairness. Let's call the unfairness number of a cake the maximal possible difference between the areas of the largest and the smallest pieces of it.

    Your task is to find the unfairness number of a given cake.

    Input

    The first line of the input file contains a single integer number n — the number of vertices of the cake (4 ≤ n ≤ 5000). The following n lines contain two integers xi, yi each — the coordinates of the vertices (-108xi, yi ≤ 108).

    Output

    The first line of the output file must contain a single number with exactly one digit after the decimal point — the unfairness number of the cake.

    The following two lines must describe the way to split the cake to get such unfairness number. The first of them should contain three indices of vertices of the largest piece in it. The second one should contain three indices of vertices of the smallest piece. Vertices are numbered from 1 to n.

    Sample Input

    5
    0 0
    -1 6
    0 7
    2 8
    7 7

    Sample Output

    24.0
    2 5 1
    2 3 4

    Source

    样例输入

    5
    0 0
    -1 6
    0 7
    2 8
    7 7

    样例输出

    24.0
    2 5 1
    2 3 4

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部