시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
10 초 | 512 MB | 4 | 4 | 4 | 100.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}$.
2 90 90
686292993
3 90 90 90
982646785
3 120 30 60
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}$.