#540. 「Nowcoder多校 2019 Day1」Integration
「Nowcoder多校 2019 Day1」Integration
题目描述
Bobo knows that $ \int_{0}^{\infty} \frac{1}{1 + x^2}\ \mathrm{d}x = \frac{\pi}{2}$.
Given n distinct positive integers , find the value of $ \frac{1}{\pi} \int_{0}^{\infty} \frac{1}{\prod_{i = 1}^n(a_i^2 + x^2)}\ \mathrm{d}x $.
It can be proved that the value is a rational number . Print the result as .
输入格式
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains an integer n. The second line contains n integers .
- are distinct.
- The sum of does not exceed .
输出格式
For each test case, print an integer which denotes the result.
样例
样例输入
1
1
1
2
2
1 2
样例输出
500000004
250000002
83333334