Hundred Thousand Points

아직 제출이 없습니다시간 제한10초메모리 제한512 MB

문제

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

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

Formally, for each ii, a real variable α_i\[0;360)\alpha\_i \in \[0; 360) is chosen uniformly at random, and the angle is formed by two rays drawn from the point (i,0)(i, 0) at polar angles of α_i\alpha\_i and α_i+a_i\alpha\_i + a\_i degrees. The interior of the angle consists of all points located at polar angles strictly between α_i\alpha\_i and α_i+a_i\alpha\_i + a\_i degrees from the point (i,0)(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,353998\\,244\\,353 (see the Output section for details).

입력

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

The second line contains nn integers a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n (1a_i1791 \le a\_i \le 179).

출력

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

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

힌트

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

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

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