CCCGuide

Problem S1: Voronoi Villages

2018 · S1 · Original problem · DMOJ

Problem Description

In the country of Voronoi, there are NN villages, located at distinct points on a straight road. Each of these villages will be represented by an integer position along this road.

Each village defines its neighbourhood as all points along the road which are closer to it than to any other village. A point which is equally close to two distinct villages AA and BB is in the neighbourhood of AA and also in the neighbourhood of BB.

Each neighbourhood has a size which is the difference between the minimum (leftmost) point in its neighbourhood and the maximum (rightmost) point in its neighbourhood.

The neighbourhoods of the leftmost and rightmost villages are defined to be of infinite size, while all other neighbourhoods are finite in size.

Determine the smallest size of any of the neighbourhoods (with exactly 1 digit after the decimal point).

Input Specification

The first line will contain the number NN (3≤N≤100)(3 \leq N \leq 100), the number of villages. On the next NN lines there will be one integer per line, where the iith line contains the integer ViV_i, the position of the iith village (−1 000 000 000≤Vi≤1 000 000 000)(-1\ 000\ 000\ 000 \leq V_i \leq 1\ 000\ 000\ 000). All villages are at distinct positions.

Output Specification

Output the smallest neighbourhood size with exactly one digit after the decimal point.

Sample Input

5
16
0
10
4
15

Output for Sample Input

3.0

Explanation for Output for Sample Input

The neighbourhoods around 00 and 1616 are infinite. The neighbourhood around 4 is 55 units (22 to the left, and 33 to the right). The neighbourhood around 10 is 5.55.5 units (33 to the left and 2.52.5 to the right). The neighbourhood around 15 is 3.03.0 units (2.52.5 to the left and 0.50.5 to the right).

A number line with 0, 4, 10, 15, and 16 marked. The described neighbourhood for each value is plotted as an interval around this value on the number line.