static int next(int[] arr, double target)
int start = 0, end = arr.Length - 1;
int mid = (start + end) / 2;
static double avg_first_last(int[] arr)
return (arr[0]+arr[arr.Length - 1])/2;
static bool isMajority(int index, int n)
public static void Main()
int[] arr = { 1, 2, 3, 9, 10, 12 ,13 ,14 };
Console.WriteLine(avg_first_last(arr));
Console.WriteLine(next(arr, 7));
Console.WriteLine(isMajority(next(arr, avg_first_last(arr)),n));