PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000051. Ước lượng số Pi từ các cặp nguyên tố cùng nhau (Pi)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Ước lượng số Pi từ các cặp nguyên tố cùng nhau (Pi)

Pi

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given NN positive integers, let CC be the number of index pairs i<ji<j with GCD 11, and let T=N(N−1)/2T=N(N-1)/2. If C=0C=0, print the prescribed failure message. Otherwise estimate $$\widehat\pi=\sqrt{\frac{6T}{C}}$$ and print exactly six decimal places.

Input

First line: NN. Second line: NN positive integers.

Output

Print the estimate with six digits after the decimal point, or No estimate for this data set..

Subtasks

  • Subtask 1 (20 points): 2≤N≤82 \le N \le 8; 1≤ai≤1001 \le a_i \le 100
  • Subtask 2 (30 points): 2≤N≤302 \le N \le 30; 1≤ai≤10001 \le a_i \le 1000
  • Subtask 3 (50 points): 2≤N≤502 \le N \le 50; 1≤ai≤100001 \le a_i \le 10000

Examples

Input

3
2 3 4

Output

3.000000

Explanation

There are T=3T=3 pairs and C=2C=2 coprime pairs, so the estimate is 9=3.000000\sqrt{9}=3.000000.