Largest Fraction

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Given a set of N numbers, can you output the largest possible value that can be made by dividing two different numbers in the set?

Input Specification

The first line will contain a single integer N (2 \leq N \leq 10^5), the number of numbers in the set.

The next line will contain N space-separated integers x_1, x_2, \ldots, x_N (1 \leq x_i \leq 10^9). Each integer is guaranteed to be unique.

Output Specification

Output a single decimal, the largest possible value, rounded to 4 decimal places.

Subtasks

Subtask 1 [20%]

N \leq 10^3

Subtask 2 [80%]

No additional constraints.

Sample Input 1

5
10 2 8 92 4

Sample Output 1

46.0000

Sample Input 2

3
159 900 49

Sample Output 2

18.3673

Comments

There are no comments at the moment.