In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
Autobyte Company is involved in the construction of one of Byteland motorways. Until recently the company collected toll charges only at the starting point of the motorway. However, Byteasar, the new chairman in charge of the company, noticed that in such a case the charged amount does not depend on the distance covered by customers in bytemiles. Therefore, the company plans to build toll-collecting points along the entire length of the motorway.
Byteasar, during his motorway trip, with the help of the odometer in his car, put down the location of all the entry points (the position of an entry point is its distance from the start of the motorway). The company decided to locate toll-collecting points evenly along the motorway. That means the distance between each two subsequent toll-collecting points would be the same. At the same time between each two such points there should be a motorway entry point and there should be toll-collecting point between each two subsequent motorway entries. Luckily, it turned out that the existing location of entry points makes possible such an arrangement.
Your task would be to calculate the minimum and maximum distance between toll-collecting points. Formally speaking, we are seeking the lowest and highest value for , for which there exists a position of first toll-collecting point, such that the consecutive points should be located in positions. It may be so that the location of a given toll-collecting point, determined by the above procedure, falls in exactly the same position, as the location of an entry point. In this case the toll booth would be positioned in close vicinity of an entry point, either just before or just after it. In other words, the position of the -th entry point should be included in the following interval .
The first line of input contains one integer (): the number of motorway entry points. The second line of input contains an increasing sequence of integers (). The following sequence elements are the positions of subsequent motorway entry points.
Your program should produce two real numbers presenting smallest and largest possible distance between two subsequent toll collecting points in bytemiles. You can assume that the difference between these values is not less than .
Your result will be considered as being correct in case it is included in the interval , where is the correct answer, . Therefore both relative error and absolute error of the answer equal to will be accepted.
For the input data:
6 2 3 4 5 6 7
the correct result is:
Task author: Jakub Radoszewski