using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
List<int> iList = new List<int>();
int[] arrayInt = { 6, 17, 8, 5, 25 };
Console.Write("Enter number: ");
int input = int.Parse(Console.ReadLine());
for (int i = 0; i < arrayInt.Length; i++)
iList.Add(arrayInt[i] - input);
int highestnum = iList.Max();
for (int x = 0; x < iList.Count; x++)
if ((iList[x] < highestnum & iList[x] >= 1) || iList[x] == highestnum)
Console.WriteLine(arrayInt[index]);