## Task 4 - 340734

A quadrilateral is called convex if and only if all its diagonals lie entirely within the area of the polygon.

How many diagonals does a convex 1995-gon have in total? Justify the number you provide!
For each of the 1995 vertices of the 1995-gon, one can consider the line segment connecting it to each of the 1994 other vertices. This way, each of the total line segments between any two vertices has been considered exactly twice.

Therefore, there are exactly $1995 \cdot 1994: 2 = 1995 \cdot 997$ such line segments. Of these, exactly 1995 are not diagonals but sides of the 1995-gon.

The number of diagonals is therefore $1995 \cdot 997 - 1995 = 1995 \cdot 996 = 1987020$.