2736Regular Convex Polygon

2736   Regular Convex Polygon

题目描述

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?

输入格式:

Each test case consists of three lines. Line i consists of two floating point values xi and yi (-104 <=x1, y1 <= 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 er 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 nish with a line containing the word END.

输出格式:

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

输入样例 复制
-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
输出样例 复制
3
4

说明

2
2
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度