Micchan noticed that an umbrella is a regular polygon when looking from above. So, she created the following problem.
Umbrella Query
A regular polygon has edges and diagonals. Consider the union of them, which includes line segments.
How many pairs of line segments satisfy the following 2 conditions?
- The 2 line segments have a common endpoint. In other words, they have a common point at one of the vertices of the regular polygon.
- The 2 line segments are perpendicular.
Micchan has given of the above problems. However, her friend cannot solve too many requests. Answer each problem on her behalf.