MaxDistanceMonotonic

https://codility.com/demo/results/demoXD8V4F-9HU/