编程介的小学生 2019-09-01 22:09 采纳率: 20.5%
浏览 100

Largest Triangle 程序编写代码的方法

Problem Description
You have a convex polygon. You select three consecutive vertices and create a triangle with them. Remove this triangle from the polygon (if you had a polygon with N vertices, the resulting polygon would have N-1 vertices). Repeat this process until the remaining polygon is a triangle.
You are given the vertices of the polygon in clockwise order. Output the largest possible triangle that can remain at the end.

Input
There are multiple cases (no more than 150).
The first line of each case is an integer n indicating the number of vertices in this polygon (3 <= n && n <= 50).
Then n lines follow, each with two integers x y (0 <= x <= 100, 0 <= y <= 100), giving the cordinate of the vertices.

Output
For each case, output the largest possible triangle that can remain at the end. Keep one digit after the decimal point.

Sample Input
3
1 1
2 3
3 2

4
1 1
1 2
3 3
2 1

Sample Output
1.5
1.5

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题