#t490. 多边形内角和

多边形内角和

Interior Angle Sum of a Polygon

Problem Description

In Euclidean geometry, the sum of interior angles of an nn-gon (2<n≤10002 < n \le 1000) is (n−2)×180∘(n - 2) \times 180^\circ. Given (n−1)(n - 1) of the interior angles, you can compute the remaining unknown angle. Write a program to solve this.

Input Format

The first line contains only one integer nn. The second line contains (n−1)(n - 1) positive integers: the degrees of each known interior angle. Adjacent integers are separated by a single space.

The data guarantees the polygon is valid.

Output Format

One positive integer: the degree of the unknown angle.

Sample Input

3
45 60

Sample Output

75

Constraints

2<n≤10002 < n \le 1000.

Hint

  • Compute (n−2)×180(n - 2) \times 180, subtract the sum of the given angles, and print the remainder.