#P10679. 『STA - R6』spec

    ID: 9878 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数学洛谷原创Special JudgeO2优化枚举洛谷月赛

『STA - R6』spec

Description

The spectrum Spec(α)\operatorname{Spec}(\alpha) of a real number α\alpha is an infinite sequence of integers defined as $\lceil \alpha \rceil - 1, \lceil 2\alpha \rceil - 1, \lceil 3\alpha \rceil - 1, \cdots$. For example, the beginning of the spectrum of 35\frac{3}{5} is 0,1,1,2,2,3,4,0, 1, 1, 2, 2, 3, 4, \cdots.

Given nn integers x1,x2,,xnx_1, x_2, \ldots, x_n, find the largest real number α\alpha such that every xix_i appears in Spec(α)\operatorname{Spec}(\alpha).

Input Format

The first line contains a positive integer nn.

The second line contains nn positive integers x1,x2,,xnx_1, x_2, \ldots, x_n.

Output Format

Output the largest α\alpha. Your answer will be considered correct if its absolute error is less than 10510^{-5}.

3
1 2 3
1.3333333
3
2 4 7
2.5000000

Hint

This problem uses subtask scoring.

Data Constraints:

  • Subtask 0 (10 points): n,xi100n, x_i \le 100.
  • Subtask 1 (15 points): Valid answers form a continuous interval.
  • Subtask 2 (25 points): Every xix_i is a non-negative integer power of 2.
  • Subtask 3 (50 points): No additional constraints.

For all test cases, 1n,xi10001 \le n, x_i \le 1000.

Translation by DeepSeek R1