시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 512 MB444100.000%

문제

You have placed $n$ points on a plane at coordinates $(1, 0), (2, 0), \ldots, (n, 0)$. 

Informally, for each $i$, you draw an angle of $a_i$ degrees from vertex $(i, 0)$ in a direction chosen uniformly at random and independently from other angles.

Formally, for each $i$, a real variable $\alpha_i \in [0; 360)$ is chosen uniformly at random, and the angle is formed by two rays drawn from the point $(i, 0)$ at polar angles of $\alpha_i$ and $\alpha_i + a_i$ degrees. The interior of the angle consists of all points located at polar angles strictly between $\alpha_i$ and $\alpha_i + a_i$ degrees from the point $(i, 0)$.

Two angles are considered intersecting if there exists a point belonging to the interiors of both angles.

Find the probability that no two angles intersect, modulo $998\,244\,353$ (see the Output section for details).

입력

The first line contains a single integer $n$ ($2 \le n \le 10^5$).

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 179$).

출력

Print the probability that no two angles intersect, modulo $998\,244\,353$.

Formally, let $M = 998\,244\,353$. It can be shown that the required probability can be expressed as an irreducible fraction $\frac{p}{q}$, where $p$ and $q$ are integers and $q \not \equiv 0 \pmod{M}$. Print the integer equal to $p \cdot q^{-1} \bmod M$. In other words, print such an integer $x$ that $0 \le x < M$ and $x \cdot q \equiv p \pmod{M}$.

예제 입력 1

2
90 90

예제 출력 1

686292993

예제 입력 2

3
90 90 90

예제 출력 2

982646785

예제 입력 3

3
120 30 60

예제 출력 3

795861094

힌트

In the first example test, the actual probability is $\frac{5}{16}$.

In the second example test, the actual probability is $\frac{1}{64}$.

In the third example test, the actual probability is $\frac{347}{5184}$.