Last month, millions of people around the world took the streets in what could be largest environmental protest in history. Many posters had: “There is no PLANet B!” written on them.
Fito and his friend were part of the protests because they also believe that our beautiful planet is under a huge threat. The weather is more extreme and the oceans have a lot of plastic. Moreover, industrial production, farming methods and mass deforestation have led to the extinction of many species. They know that if we continue like this, it’s almost certain that sea levels will continue to rise, there will be extreme heat-waves, loss of the polar ice caps and mass pollution; in short, a very worrying future for us all. Therefore, we need to do something before it’s too late.
Fito and his friend decided to take action and will plant as many trees as they can. They have a sequence of positions $\lbrace A_i \rbrace$ of length $N$ where it would be nice to have a tree (there could be some repeated positions). Each position is represented by an integer that indicates the distance to the start of the street (they will plant all the trees in the same street). Your task is to help Fito and his friend to find out what is the maximum distance between any two trees they will plant.
Print the maximum absolute difference between two positions.
In the first case, the maximum absolute difference of two positions is $A_3−A_1=6−1=5$.