#K61857. Total Internal Angle Sum of a Convex Polygon
Total Internal Angle Sum of a Convex Polygon
Total Internal Angle Sum of a Convex Polygon
Given the number of sides of a convex polygon and the lengths of its sides, compute the sum of its internal angles in degrees. Note that the side lengths are provided for formality and do not affect the computation. You can use the formula:
$$ S = (k - 2) \times 180 $$
where k is the number of sides. For example, a triangle (k = 3) has an internal angle sum of 180° and a square (k = 4) has 360°.
inputFormat
The input consists of two lines:
- The first line contains a single integer k (k ≥ 3), representing the number of sides of the polygon.
- The second line contains k space-separated integers representing the lengths of the sides. (The side lengths do not affect the result.)
outputFormat
Output a single integer representing the sum of the internal angles of the polygon in degrees.
## sample3
3 4 5
180