F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Largest Triangle

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 440    Accepted Submission(s): 234


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
 

Author
hhanger@zju
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 23:00:14, Gzip enabled