Pro.ID21635 TitlePancake Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21635 AC0 Submit0 Ratio- 时间&空间限制描述One time, Anthony has made a pancake, whose shape is a simple polygon. Anthony wants to cut the pancake into pieces with a knife. He is wondering what the maximum number of pieces he can get after one single cut is. He needs your help. Figure 1 example Notice that you can not cut the pancake through a vertex, as in Figure 1. 输入The input is a sequence of data sets, each has the following format. n x1 y1 ... xn yn The first line contains an integer n ( 3 ≤ n ≤ 100 ), which is the number of vertices. And the following n lines contains n different point, each line represents a vertex. Edges of the polygon connect vertices given in two adjacent vertex data lines, and in the last and the first vertex data lines. ( -100000000 ≤ xi, yi ≤ 100000000, both are integers ). Edges intersect only at vertices. Three vertices may stand on one line. The input is ended by n = 0. 输出Description One time, Anthony has made a pancake, whose shape is a simple polygon. Anthony wants to cut the pancake into pieces with a knife. He is wondering what the maximum number of pieces he can get after one single cut is. He needs your help. Figure 1 example Notice that you can not cut the pancake through a vertex, as in Figure 1. Input The input is a sequence of data sets, each has the following format. n x1 y1 ... xn yn The first line contains an integer n ( 3 ≤ n ≤ 100 ), which is the number of vertices. And the following n lines contains n different point, each line represents a vertex. Edges of the polygon connect vertices given in two adjacent vertex data lines, and in the last and the first vertex data lines. ( -100000000 ≤ xi, yi ≤ 100000000, both are integers ). Edges intersect only at vertices. Three vertices may stand on one line. The input is ended by n = 0. Output Output one integer for each input case, representing the largest number of pieces. Sample Input 5 Sample Output 3 Source 样例输入5 样例输出3 作者 |