Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Connect the Dots
Description Given a rectangular region of the plane which has been divided into polygons, decide what the maximum number of edges that any of the polygons has. For example, if the region is divided into triangles, then the maximal number is 3. If the region is divided into, say, 7 triangles and 2 squares, then the maximal number is 4. There will be a list of pairs of ( Figure 1 is a sketch of an example 3 x 3 rectangular region divided into five 3-gons, a 5-gon and a 10-gon. The pairs of coordinates representing the edges of the 5-gon would be: The maximal number of edges in this example is 10. That is, this example has a 10-gon. Input The input consists of multiple test cases. The first line of each test case will consist of an integer Output The output should be an integer describing the maximal number of edges that any of those Sample Input 21 1 1 1 2 1 2 1 3 1 3 1 4 1 1 2 1 2 1 3 1 3 1 4 1 1 4 2 4 2 4 3 4 3 4 4 4 4 1 4 2 4 2 4 3 4 3 4 4 2 3 2 4 2 3 3 4 2 3 3 3 3 3 3 4 3 3 4 2 2 1 3 2 3 2 3 1 4 1 3 2 3 2 4 2 0 Sample Output 10 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator