Catalog
Geometry
1 easy version
Content: trangle
Link:Problem - C1 - Codeforces
Solution:
Theorem: Any ploygon with n vertices can be triangulated into exactly n-2 triangles.
If the proof is unclear, further explanation can be found in the following video:
Now, introduce the concept of a valid vertex. The solution involves calculating the number of valid vertices and then subtracting 2. The procedure is as follows:
1. For a set of chosen vertices, denoted by x, all these vertices are considered valid.
2. For vertices not included in x but part of the total n vertices, a vertex is deemed valid if it is exactly adjacent to two chosen vertices.
Note: The first chosen vertex is also adjacent to the last chosen vertex in x.
Latex :
2 hard version
Content: trangle
Link:
Answer: