I need to put numbers in an array and take the ones that are at equal distances from the end of the interval
Example: 6 numbers, {3, 4, 6, 36, 45, 97} -> 3 and 97,