8623: Particle Arts

内存限制:256 MB 时间限制:1 S
题面:传统 评测方式:Special Judge 上传者:
提交:0 通过:0

题目描述

In a confined NIO space, there are nnn NIO particles, the iii-th of which has aia_iai joule energy. The NIO particles are very special as they keep colliding with each other randomly. When one particle carrying energy aaa joule collides with another particle carrying energy bbb joule, they will be annihilated and produce two new particles carrying the energy of a AND ba\ \texttt{AND}\ ba AND b and a OR ba\ \texttt{OR}\ ba OR b respectively. Here AND\texttt{AND}AND and OR\texttt{OR}OR mean bitwise AND and OR operation respectively.

The variance of the energy of these particles is obviously not decreasing, but unfortunately, the space here is too small for the author to write down his proof. After enough time the variance of the energy of these particles converges to a stable value. Can you find this value?

The variance of nnn numbers is defined as follows.

σ2=1n∑i=1n(xi−μ)2where μ=1n∑i=1nxi\begin{aligned} \sigma^2 &= \frac{1}{n}\sum\limits_{i=1}^{n}(x_i - \mu)^{2} \\ \text{where}\ \mu &= \frac{1}{n}\sum\limits_{i=1}^{n}x_i \\ \end{aligned}σ2where μ=n1i=1n(xiμ)2=n1i=1nxi

输入格式

The first line contains an integer nnn (2≤n≤1052\le n\le 10^52n105), indicating the number of particles.
The second line contains nnn integers a1,a2,…,ana_1,a_2,\ldots, a_na1,a2,,an (0≤ai<2150\le a_i < 2^{15}0ai<215), indicating the enegery of the particles.

输出格式

Output a irreducible fraction ab\dfrac{a}{b}ba (b>0b > 0b>0) in the form of a/b\texttt{a/b}a/b that represents the answer. You should ensure that gcd⁡(a,b)=1\gcd(a,b) = 1gcd(a,b)=1 or when a=0a=0a=0, bbb should be 111.

输入样例 复制

5
1 2 3 4 5

输出样例 复制

54/5

数据范围与提示

Warm tip: Please note the use of data types.

分类标签