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

Regular Convex Polygon

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1417    Accepted Submission(s): 455


Problem Description
A regular convex polygon is a polygon where each side has the same length, and all interior angles are equal and less than 180 degrees. A square, for example, is a regular convex polygon. You are given three points which are vertices of a regular convex polygon R; can you determine the minimum number of vertices that R must have?
 

Input
Each test case consists of three lines. Line i consists of two floating point values xi and yi (-104 <=xi,yi<=104) where (xi,yi) are the coordinates of a vertex of R. The coordinates are given with a precision of 10-6, i.e., they di ffer from the exact coordinates by at most 10-6. You may assume that for each test case the Euclidean distance between any two given points is at least 1, and R has at most 1000 vertices. The input will finish with a line containing the word END.
 

Output
For each test case, print one line with the minimum number of vertices that R must have.
 

Sample Input
-1385.736326 -146.954822 430.000292 -2041.361203 1162.736034 478.316025 0.000000 4147.000000 -4147.000000 0.000000 0.000000 -4147.000000 END
 

Sample Output
3 4
 

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 11:28:42, Gzip enabled